简体   繁体   中英

icudt error while installing stringi library in R

I'm writing this because it took me several days to come to this result.

Bottom line: The stringi library version 1.1.3 (released March 2017) might have issues involving icudt. You can install stringi 1.1.2 using the following commands:

packageurl <- "https://cran.r-project.org/src/contrib/Archive/stringi/stringi_1.1.2.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

I put this together from some RStudio documentation on how to install an older package .

Background:

I was trying to install the forecast library in R. Originally, I was using R 3.1.2. I also installed R 3.3.3 and tried to install stringi it. I'm running CentOS 6.7 and don't have a choice to upgrade.

Forecast failed to install due to issues installing stringi. The stringi library failed to install due to errors downloading ICU data library (icudt) It looks like stringi 1.1.3 added download/build logic regarding icudt, and upcoming version 1.1.4 has corrections to this logic (as of date 2017-04-02).

I went to the ICU project site: and downloaded/installed the ICU library that appeared to be specified in the error messages below:

checking whether we may compile src/icu55/common/umapfile.c... yes
checking whether we may compile src/icu55/common/putil.cpp... yes
checking whether we can fetch icudt... WARNING: ignoring environment value of R_HOME
downloading ICU data library (icudt)
output path: icu55/data/icudt55l.zip
Error in stri_download_icudt("icu55/data") :
  could not find function "dir.exists"
Calls: identical -> stri_download_icudt
Execution halted
*** icudt could not be downloaded. stopping.
ERROR: configuration failed for package ‘stringi’

Searches online for icu55, icudt55l.zip, or any procedure that followed to get past this error didn't turn up a procedure that worked. I downloaded, built, and installed ICU 55.1 and also ICU 58.2. I also updated gcc and g++. The CRAN repository install notes for stringi 1.1.3 don't currently give a straightforward set of instructions to successfully install stringi when I have a working internet connection.

I started by asking this as a question and then found my answer. I'll post it anyways. I had added several links but needed to remove them because I don't have enough cred to get away with them.

This has nothing to do with ICU. This is a bug in stringi, which I have already fixed in version 1.1.5 (now on CRAN). The dir.exists() function is specific to R ≥ 3.2.0 - I wasn't aware of that. Sorry for inconvenience.

The stringi library version 1.1.3 (released March 2017) might have issues involving icudt. You can install stringi 1.1.2 using the following commands:

packageurl <- "https://cran.r-project.org/src/contrib/Archive/stringi/stringi_1.1.2.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

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