difficulty in importing xlsx file

Hi all,

I am trying to import xlsx file into R using many ways. None of them works.

I tried "Import Dataset" via the Environment tab. I got an error message saying

.onLoad failed in loadNamespace() for 'Rcpp', details:
call:new_dummyObject(.dummyInstancePointer)
error:object'class__dummyInstance' not found.

I also tried to install readxl package. It was successfully installed, but when I call the package using library(readxl) there is a warning message saying

Error: package or namespace load failed for ‘readxl’:
.onLoad failed in loadNamespace() for 'Rcpp', details:
call: new_dummyObject(.dummyInstancePointer)
error: object 'class__dummyInstance' not found
In addition: Warning message:
package ‘readxl’ was built under R version 4.0.5

sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Any help will be much appreciated.

I think you need to update the Rcpp package. Good luck!

2 Likes

I agree with @maelle, you definitely need to update Rcpp

install.packages("Rcpp")
2 Likes

Hi Maelle and Andressrcs,

I tried to install the Rcpp packages. When I called it the error message below comes up.

Error: package or namespace load failed for ‘Rcpp’:
.onLoad failed in loadNamespace() for 'Rcpp', details:
call: new_dummyObject(.dummyInstancePointer)
error: object 'class__dummyInstance' not found
In addition: Warning message:
package ‘Rcpp’ was built under R version 4.0.5

That's weird, Can you post the complete output message you get when you try to install Rcpp?

sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

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

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

loaded via a namespace (and not attached):
[1] compiler_4.0.4 tools_4.0.4

install.packages("Rcpp")
Installing package into ‘C:/R/R-4.0.3/library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/Rcpp_1.0.7.zip'
Content type 'application/zip' length 3262273 bytes (3.1 MB)
downloaded 3.1 MB

package ‘Rcpp’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\utsanat\AppData\Local\Temp\Rtmpgr3ZBO\downloaded_packages

library(Rcpp)
Error: package or namespace load failed for ‘Rcpp’:
.onLoad failed in loadNamespace() for 'Rcpp', details:
call: new_dummyObject(.dummyInstancePointer)
error: object 'class__dummyInstance' not found
In addition: Warning message:
package ‘Rcpp’ was built under R version 4.0.5

There seems to be a mismatch between your R version (4.0.4) and your package library (which seemed have been compiled under R 4.0.3).

Hard to pin point the exact problem so I think it would be easier to update to the latest R version 4.1.1, move your existing system level package library to the new location (whiteout overwriting the base R packages) and then reinstall all your packages for that version using update.packages(checkBuilt = TRUE). Also, make sure you are not pointing your libpaths to the old system library.

1 Like

Thanks andresrcs. I will give it a go.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.