stringr 不会安装在 R 中

stringr will not install in R

我在安装 stringr 时遇到问题。这是我请求安装 stringr 时得到的结果:

utils:::menuInstallPkgs()
also installing the dependency ‘stringi’

There are binary versions available but the source versions are later:

        binary source needs_compilation

stringi  1.1.5  1.1.6              TRUE

stringr  1.2.0  1.3.0             FALSE

Binaries will be installed
trying URL 'https://ftp.ussg.iu.edu/CRAN/bin/windows/contrib/3.2/stringi_1.1.5.zip'

Content type 'application/zip' length 14220135 bytes (13.6 MB)
downloaded 13.6 MB

package ‘stringi’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\AppData\Local\Temp\RtmpsjXf2p\downloaded_packages
installing the source package ‘stringr’


trying URL 'https://ftp.ussg.iu.edu/CRAN/src/contrib/stringr_1.3.0.tar.gz'
Content type 'application/x-gzip' length 118333 bytes (115 KB)
downloaded 115 KB

* installing *source* package 'stringr' ...
** package 'stringr' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
namespace 'stringi' 1.1.5 is being loaded, but >= 1.1.6 is required
ERROR: lazy loading failed for package 'stringr'
* removing 'C:/Users/Documents/R/win-library/3.2/stringr'

Thank you for any help you might provide.  

您可以在错误消息中看到:

'stringi' 1.1.5 is being loaded, but >= 1.1.6 is required

而且当它安装时 stringi 它说:

There are binary versions available but the source versions are later:

所以,你需要强制安装源码包。试试这个:

utils:::menuInstallPkgs(type="source")

或者只是

install.packages("stringr", type="source")

R 社区普遍doesn't support old versions。 3.2 系列的最后一个版本大约是两年前发布的。建议更新到最新的稳定版本。