Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load, detach, re-load anomaly

I'm attaching, detaching, and re-attaching RODBC and data.table. When I perform this process with these packages in this order, I get the following error:

Error : .onLoad failed in loadNamespace() for 'data.table', details:
  call: address(x)
  error: object 'Caddress' not found

I'm using the latest versions of these packages. This is my initial session info:

R version 3.1.0 (2014-04-10)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

Example

pkgs <- c('RODBC', 'data.table') # Note, c('data.table', 'RODBC') will work
for (pkg in pkgs) library(pkg, character.only=TRUE)
for (pkg in paste0('package:', pkgs)) detach(pkg, unload=TRUE, character.only=TRUE)
for (pkg in pkgs) library(pkg, character.only=TRUE)
like image 977
Matthew Plourde Avatar asked May 06 '14 15:05

Matthew Plourde


1 Answers

This is now fixed in commit 1332 of v1.9.3. From NEWS:

Added a .onUnload method to unload data.table's shared object properly. Since the name of the shared object is 'datatable.so' and not 'data.table.so', 'detach' fails to unload correctly. This was the reason for the issue reported here on SO. Closes #474. Thanks to Matthew Plourde for reporting.

like image 71
Arun Avatar answered Oct 04 '22 18:10

Arun