Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got error when using data.table in qmd code #46

Open
iMissile opened this issue Feb 7, 2023 · 0 comments
Open

Got error when using data.table in qmd code #46

iMissile opened this issue Feb 7, 2023 · 0 comments

Comments

@iMissile
Copy link

iMissile commented Feb 7, 2023

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)
@iMissile iMissile changed the title Error when using data.table in qmd code Got error when using data.table in qmd code Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant