Loading caret package error


For discussions related to modeling, machine learning and deep learning. Related packages include caret, modelr, yardstick, rsample, parsnip, tensorflow, keras, cloudml, and tfestimators.

Hi, I just installed caret package in my R program and its dependencies but when I load it, it displays an error message,

"The procedure entry point DATAPTR could not be located in the dynamic link library R.dll."

and in the console message,

"Error: package or namespace load failed for ‘caret’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Users/a077001049/Documents/R/win-library/3.4/stringi/libs/i386/stringi.dll':
LoadLibrary failure: The specified procedure could not be found."

What is the problem in my installation process?



Can you give use the results of sessionInfo() and some details (e.g. code) for how you tried to installed it?


Hi Max,

Here's the result of the sessionInfo()

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

Matrix products: default

[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[5] LC_TIME=English_United States.1252

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

other attached packages:
[1] lattice_0.20-35

loaded via a namespace (and not attached):
[1] compiler_3.4.4 gtable_0.2.0 grid_3.4.4

Also, I manually installed the caret dependencies since our system resticts us to link to outside servers.



How, exactly, did you do this?


Hi Max,

The system will notify lacking packages everytime I load the caret packages. So I downloaded the package from cran site.


Which site? cran.r-project.org, cran.rstudio.com, or a mirror? Did you use the Windows "install from zip file" menu option?

It's possible that you are installing binary packages for a later version (say 3.5) on an older version that they were not compiled for.

I get that you have to do it manually, but it's hard to trace back the issue without details.


I downloaded the packages from cran.r-project.org and installed it using "install from zip file menu option.

Maybe the packages for a later version (3.5) is causing the problemproblem. You think its better to remove the packages and install again?


Did you try to re-install stringi? It seems to be the one missing a .dll.

Try running install.packages("stringi") and see if that helps.


Yes, I reinstalled stringi several times. The same problem


The only thing that I can think of is to install using the "r-oldrel" files on the package websites.


Hi Max, how to install that? Where to find? Is it a package?


If you do it manually, each page on CRAN package page has different binary versions of the packages. For example:

Package source: caret_6.0-79.tar.gz
Windows binaries: r-devel: caret_6.0-79.zip, r-release: caret_6.0-79.zip, r-oldrel: caret_6.0-79.zip
OS X binaries: r-release: caret_6.0-79.tgz, r-oldrel: caret_6.0-79.tgz

Since you are not on the current version, you would want the binary for "r-oldrel".

However... if you can't install to the standard library directory, you could install to a different library using:

install.packages(c("caret"), repos = "http://cran.r-project.org", type = "binary", 
                 destdir = "some/path/that/you/can/write/to")

When you start R, you can access these using:


before loading the library.


Hi Max,

I tried the r-oldrel, and it seems workingm but when I installed the rcpp binaries old version, it says that the rcpp.rdb is corrupt. See below


Try restarting the session (and make sure not to have other sessions open) and see if the package loads.

Make sure that you only have a single (fresh) session open when installing.