You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following discussion on StackOverflow ([http://stackoverflow.com/questions/38016170/getting-a-printing-error-while-assigning-vector-to-data-table-column/38073502#38073502]) I seem to have encountered a bug. This occurs when assigning to a pre-allocated table column.
Error message:
Error in SYS[[length(SYS) - 3L]][[1L]] == "knit_print.default" :
comparison (1) is possible only for atomic and list types
The code does not crash and the error is not printed to the console until I attempt to display the value of the table or of its containing structure. The error occurs only when the assignment is executed from source code. If I interrupt the execution and paste the offending assignment into the console, it executes without problem.
Searching the internet for the error, I found literally nothing, except for the source code of data.table here on github. The relevant code is in lines 45-50, and seems to regard supressing knitr print output for in-place assignments.
The error still exists in the latest dev version of data.tables from github.
Minimal reproducible example:
alloc_out<-function(annot= c("a", "b")) {
Genes<- data.table("parent"=annot, flag=NA)
ro<- structure(list("Genes"=Genes), class=c("dtu")) # This sets up the error.# ro <- structure(list("Genes" = Genes)) # This alternative does not lead to the error.ro$Genes[, flag:=TRUE] # This causes error in source, but works in console.return(ro)
}
The error seems to be triggered by the line encapsulating the table into a strucutre. Specifically my use of a class attribute. Omitting the class attribute, leads to no error.
Session info:
R version 3.2.4 (2016-03-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.5 (El Capitan)
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rats_0.1 data.table_1.9.6
loaded via a namespace (and not attached):
[1] Rcpp_0.12.4 matrixStats_0.50.2 digest_0.6.9 withr_1.0.1 chron_2.3-47 jsonlite_0.9.19 magrittr_1.5 stringi_1.0-1 devtools_1.11.0 tools_3.2.4 stringr_1.0.0 htmlwidgets_0.6 yaml_2.1.13
[14] parallel_3.2.4 memoise_1.0.0 htmltools_0.3.5
(rats_0.1 is my package in development, where this bug became apparent)
The text was updated successfully, but these errors were encountered:
Following discussion on StackOverflow ([http://stackoverflow.com/questions/38016170/getting-a-printing-error-while-assigning-vector-to-data-table-column/38073502#38073502]) I seem to have encountered a bug. This occurs when assigning to a pre-allocated table column.
Error message:
The code does not crash and the error is not printed to the console until I attempt to display the value of the table or of its containing structure. The error occurs only when the assignment is executed from source code. If I interrupt the execution and paste the offending assignment into the console, it executes without problem.
Searching the internet for the error, I found literally nothing, except for the source code of data.table here on github. The relevant code is in lines 45-50, and seems to regard supressing knitr print output for in-place assignments.
The error still exists in the latest dev version of data.tables from github.
Minimal reproducible example:
The error seems to be triggered by the line encapsulating the table into a strucutre. Specifically my use of a class attribute. Omitting the class attribute, leads to no error.
Session info:
(rats_0.1 is my package in development, where this bug became apparent)
The text was updated successfully, but these errors were encountered: