简体   繁体   中英

There is no package called 'stringi' when using library 'car'

Purpose

I was trying to use vif() function from the car package of R.

Initial Error Messages

When I first executed vif(X) , an error message popped up as:

Error in vif(mod1) : could not find function "vif"

I tried library(car) and get a following error as:

Error: package or namespace load failed for ‘car’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘stringi’

References

I read and tried the following references until I solved the problem:

  1. https://github.com/gagolews/stringi/issues/178

Solution

Step 1: Remove "stringi"

$ wget https://github.com/Rexamine/stringi/archive/master.zip
$ unzip master.zip
$ R CMD INSTALL stringi-master --preclean

Step 2: Reinstall "stringi" from binary (NOT source)

R$ install.packages('stringi')

You will be asked:

There is a binary version available but the source version is later:
        binary source needs_compilation
stringi  1.4.5  1.4.6              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel)

Please answer no to install from binary.

Solved

Now try:

R$ library(car)
R$ ?vif

And everything works fine.

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