1

Ran a test for data.table on my new installation of R and got the below errors:

> test.data.table()
Error in eval(exprs[i], envir) : 
  10 errors out of 8403 (lastID=1887, endian==little, sizeof(long 
double)==16, sizeof(pointer)==8) in inst/tests/tests.Rraw on Tue Apr 03 
11:28:16 2018. Search tests.Rraw for test numbers: 546, 1693.4, 1693.5, 
1693.6, 1693.7, 1693.9, 1702.1, 1702.2, 1702.3, 1702.4.

All errors were of the kind:

Test testnum ran without errors but failed check that x equals y:

Where testnum is the test that failed (from above message).

Some more details:

R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_Canada.1252  LC_CTYPE=English_Canada.1252    LC_MONETARY=English_Canada.1252
[4] LC_NUMERIC=C                    LC_TIME=English_Canada.1252    

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] rmarkdown_1.9     curl_3.1          caret_6.0-78      lattice_0.20-35   xts_0.10-1        zoo_1.8-1        
 [7] nlme_3.1-131.1    hexbin_1.27.2     testthat_2.0.0    plyr_1.8.4        knitr_1.20        bit64_0.9-7      
[13] bit_1.1-12        ggplot2_2.2.1     lubridate_1.7.2   data.table_1.10.5 gmad_0.0.0.9000   reshape2_1.4.3   
[19] reshape_0.8.7    

loaded via a namespace (and not attached):
 [1] httr_1.3.1         ddalpha_1.3.1.1    tidyr_0.8.0        sfsmisc_1.1-2      splines_3.4.4     
 [6] foreach_1.4.4      prodlim_1.6.1      assertthat_0.2.0   highr_0.6          stats4_3.4.4      
[11] DRR_0.0.3          yaml_2.1.17        robustbase_0.92-8  ipred_0.9-6        pillar_1.2.1      
[16] backports_1.1.2    glue_1.2.0         digest_0.6.15      colorspace_1.3-2   recipes_0.1.2     
[21] htmltools_0.3.6    Matrix_1.2-12      psych_1.7.8        timeDate_3043.102  pkgconfig_2.0.1   
[26] CVST_0.2-1         broom_0.4.3        purrr_0.2.4        scales_0.5.0       gower_0.1.2       
[31] lava_1.6           tibble_1.4.2       withr_2.1.1        nnet_7.3-12        lazyeval_0.2.1    
[36] mnormt_1.5-5       survival_2.41-3    magrittr_1.5       evaluate_0.10.1    MASS_7.3-49       
[41] dimRed_0.1.0       foreign_0.8-69     class_7.3-14       tools_3.4.4        stringr_1.3.0     
[46] kernlab_0.9-25     munsell_0.4.3      bindrcpp_0.2       compiler_3.4.4     RcppRoll_0.2.2    
[51] rlang_0.2.0        grid_3.4.4         iterators_1.0.9    labeling_0.3       gtable_0.2.0      
[56] ModelMetrics_1.1.0 codetools_0.2-15   R6_2.2.2           dplyr_0.7.4        bindr_0.1         
[61] rprojroot_1.3-2    stringi_1.1.6      Rcpp_0.12.15       rpart_4.1-13       DEoptimR_1.0-8    
[66] tidyselect_0.2.4  

Using RStudio as the IDE, version 1.1.442 gmad is a local package (does not have any conflicting function names, basically a package to access some private APIs).

Not sure if this is cause for concern - didn't encounter this on any previous installations. I've seen the answer for test.data.table() error message but it's for an older version and I am seeing multiple errors (vs one).

EDIT

Restarted RStudio, test run fines when no packages (other than base) are loaded (not even data.table).

Get errors after loading some packages.

I've copied the output for both cases. Too long to post in this question - here's a pastebin link and here's another for GoogleDrive.

Regarding my local package gmad:

NAMESPACE imports:

import(data.table)
import(ggplot2)
import(httr)
importFrom(lubridate,round_date)

DESCRIPTION imports:

Imports:
  data.table,
  lubridate, 
  ggplot2,
    ggmap,
    httr

All other packages are installed from CRAN (versions noted in the session info above).

Gautam
  • 2,597
  • 1
  • 28
  • 51
  • How did you install the package? Via CRAN or from github? – R Yoda Apr 03 '18 at 18:15
  • Downloaded the latest version from their Github page, instructions here: https://github.com/Rdatatable/data.table/wiki/Installation – Gautam Apr 03 '18 at 18:17
  • So you are using the development version ("v1.10.5 in development") which can still have problems - of course this does not explain the reason for the errors ;-) Any reason you are not installing from CRAN? – R Yoda Apr 03 '18 at 18:21
  • Had some issues with using `data.table::fread()` with the last version (esp. on MacOS) - https://stackoverflow.com/questions/46637238/fread-ignores-sep-and-dec-when-reading-from-weblink – Gautam Apr 03 '18 at 18:23
  • I have build the dev version from github on Ubuntu 14.04 and run the tests (`library(data.table); test.data.table()`) with **no** errors. I know you are using Windows (not Linux). So can you please post the complete code you use to run the tests (e. g. which libraries do you load first) + add the complete output of the `test.data.table` function call. Without reproducing the error msg and debugging `data.table` it's difficult to find the reason – R Yoda Apr 03 '18 at 18:55
  • Added the required info. The first test was performed after restarting RStudio and the second after loading four packages (`gmad`, `data.table`, `lubridate` and `ggplot2`). – Gautam Apr 03 '18 at 19:38
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/168145/discussion-between-r-yoda-and-gautam). – R Yoda Apr 03 '18 at 19:41

1 Answers1

0

data.table and lubridate use the same function names for some date/time-related functions so the order of loading both libraries decides which function from which package is called by the unit tests.

See this issue for details: https://github.com/Rdatatable/data.table/issues/1135

I think to test the correct installation of data.table you shouldn't load lubridate at all.

If you want to use date/time functions in your code you have to choose which masking is better for you and load the libraries in the desired order...

library(lubridate)
library(data.table)
test.data.table()  # runs without errors

If you reset the R session and load data.table first you will get some unit test errors

library(data.table)
library(lubridate)
test.data.table()  # runs with unit test errors

saying e. g.

Running test id 546 Test 546 ran without errors but failed check that x equals y:

R Yoda
  • 8,358
  • 2
  • 50
  • 87