rstudio / webshot2

Take screenshots of web pages from R

Home Page:https://rstudio.github.io/webshot2/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Got error when using data.table in qmd code

iMissile opened this issue · comments

I'm trying to make snapshot from command line with cmd webshot2::rmdshot("test.qmd", file = "tst.png") an got error

Error in :=`(value, gear + carb) : Check that is.data.table(DT) == TRUE. 
Otherwise, := and :=(...) are defined for use in j, once only and in particular ways. 
See help(":=")

Rendering the same file in RStudio or through rmarkdown::render I've got correct .html file.

I suppose that it's caused by absense of data.table @ Import section in DESCRIPTION.
Finding reasons here:

Sample qmd sile:

library(data.table)
library(kableExtra)
library(webshot2)

data <- mtcars
df <- setDT(data)[, value := gear + carb][, .(mpg, value)]

kable(df)