Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
214 views
in Technique[技术] by (71.8m points)

r - Installing addmtoolbox on Windows : x is not a data.table (RStudio)

I'm trying to install addmtoolbox on Rstudio. every things is fine but at last i got this error:

Error: Vignette re-building failed.
Execution halted
Error: Failed to install 'addmtoolbox' from GitHub:
  System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr (last 10 lines):
E> Quitting from lines 80-84 (addmtoolbox_modelfit_walkthrough.Rmd) 
E> Error: processing vignette 'addmtoolbox_modelfit_walkthrough.Rmd' failed with diagnostics:
E> x is not a data.table
E> --- failed re-building 'addmtoolbox_modelfit_walkthrough.Rmd'
E> 
E> SUMMARY: processing the following file failed:
E>   'addmtoolbox_modelfit_walkthrough.Rmd'
E> 
E> Error: Vignette re-building failed.
E> Execution halted

also i'm trying to install package from zip file. installation is successful but when i run addm_preprocess function, i got same error:

>  my.dat = addm_preprocess(choice.dat = addm_data_choice,
+                         eye.dat = addm_data_eye,
+                         timestep = 10,
+                         rtbinsize = 100) 
Error in setkeyv(x, cols, verbose = verbose, physical = physical) : 
  x is not a data.table

would you please help me? thanks.

addmtoolbox: https://rdrr.io/github/AlexanderFengler/addmtoolbox/

EDIT: i found error code:

eye$fixdur =  timestep * round(eye$fixdur/timestep)
  rts = eye %>% group_by(id) %>% summarize(rt = sum(fixdur))
  setkey(rts,id)
  choice = choice %>% select(-rt)
  choice = choice[rts]

setkey(rts,id) return error:

> rts
# A tibble: 1 x 2
     id    rt
* <dbl> <dbl>
1     0     0
>   setkey(rts,id)
Error in setkeyv(x, cols, verbose = verbose, physical = physical) : 
  x is not a data.table
question from:https://stackoverflow.com/questions/65867066/installing-addmtoolbox-on-windows-x-is-not-a-data-table-rstudio

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

solution by : hdkrgr

It looks like you're providing a tibble when a data.table is expected. You should be able to convert the object with as.data.table. Alternatively you could also use dtyplyr for unified tibble/data.table objects. github.com/tidyverse/dtplyr


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...