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
data is a data.table. col_i and col_j are colnames of data.
diffTime is a personnal function to compute differences between two dates:
diffTime <- function(col1, col2, units = "days"){
if (units %in% c("auto", "secs", "mins", "hours", "days", "weeks")){
return(as.numeric(difftime(col1, col2, units = units)))
}
if (units == "years"){
return(as.numeric(difftime(col1, col2, units = "days")) / 365.25) # To-do: check number of days in years instead?
}
else{
stop("Sorry this unit hasn\'t been implemented yet")
}
}
This line of code is generating following mistake:
Error in set(data, i = NULL, j = newColName, value = diffTime(data[[col_i]], : Internal error, please report (including result of sessionInfo()) to datatable-help: oldtncol (0) < oldncol (20) but tl of class is marked.
Did i made a mistake using set?
As asked: my sessionInfo():
R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Hello,
I'm having some issues with set function.
data
is a data.table.col_i
andcol_j
are colnames of data.diffTime
is a personnal function to compute differences between two dates:This line of code is generating following mistake:
Did i made a mistake using set?
As asked: my sessionInfo():
locale:
[1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252 LC_MONETARY=French_France.1252 LC_NUMERIC=C
[5] LC_TIME=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] pander_0.6.0 kableExtra_0.2.1 knitr_1.16 dataPreparation_1.01.08 testthat_1.0.2 roxygen2_6.0.1
[7] devtools_1.13.2 stringr_1.2.0 lubridate_1.6.0 reshape2_1.4.2 data.table_1.10.4
loaded via a namespace (and not attached):
[1] Rcpp_0.12.11 xml2_1.1.1 magrittr_1.5 rvest_0.3.2 R6_2.2.2 highr_0.6 httr_1.2.1 plyr_1.8.4
[9] tools_3.3.3 git2r_0.18.0 withr_1.0.2 htmltools_0.3.6 commonmark_1.2 assertthat_0.2.0 yaml_2.1.14 rprojroot_1.2
[17] digest_0.6.12 crayon_1.3.2 memoise_1.1.0 evaluate_0.10.1 rmarkdown_1.6 stringi_1.1.5 desc_1.1.0 backports_1.1.0
The text was updated successfully, but these errors were encountered: