简体   繁体   中英

cannot load rms package

I'm working with R, I have installed the library 'rms' but I have the follow error:

> library(rms)
Error in library.dynam(lib, package, package.lib) : 
  DLL ‘colorspace’ not found: maybe not installed for this architecture?
Errore: package ‘ggplot2’ could not be loaded

What can I do?

If you install from base R and wish to install a package and all its dependencies, you need to use the argument dependencies = TRUE . From ?install.packages :

" dependencies = TRUE ... this installs all the packages needed to run pkgs , their examples, tests and vignettes (if the package author specified them correctly).

Hence,

install.packages("rms",dependencies = TRUE)

should do the trick.

The answer offered so far (without any upvotes so far) is useful, but incomplete. It is sometimes sufficient to execute install.packages() with dependencies = TRUE , but if the missing package is a dependency of a dependency, then install.package is not "smart" enough to recognize that fact. The ggplot2 package is in the "Depends:" line of the rms package DESCRIPTION file, but colorspace is not. Sometimes the end-user simply needs to read the error message and install the missing dependencies.

In this case, however, it appears that there may have been a version mismatch of packages and R.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM