Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

package 'stringi' does not work after updating to R3.2.1

Tags:

r

ggplot2

stringi

I saw a version of this question posted, but still did not see the answer. I am trying to use ggplot2 but get the following errors (everything worked this morning using R3.0.2 'frisbee sailing' with RStudio version 0.98.1102.

I updated both R and Rstudio and now get the following:

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

So naturally I tried:

> install.packages('stringi')

**There is a binary version available but the source version is later:
    binary source needs_compilation
 stringi  0.4-1  0.5-2             FALSE**

 installing the source package ‘stringi’

trying URL 'http://cran.rstudio.com/src/contrib/stringi_0.5-2.tar.gz'
Content type 'application/x-gzip' length 3641292 bytes (3.5 MB)
==================================================
downloaded 3.5 MB

* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
checking for local ICUDT_DIR... icu55/data
checking for R_HOME... /Library/Frameworks/R.framework/Resources
checking for R... /Library/Frameworks/R.framework/Resources/bin/R
checking for R >= 3.1.0... yes
checking for cat... /bin/cat
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: 

command not found

/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/private/var/folders/bq/3jbmwwh553s395pjg1m9h7fr0000gn/T/Rtmpugc1jZ/R.INSTALLc4677f69ffba/stringi':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/stringi’
Warning in install.packages :
  installation of package ‘stringi’ had non-zero exit status

    The downloaded source packages are in
        ‘/private/var/folders/bq/3jbmwwh553s395pjg1m9h7fr0000gn/T/RtmpXvl7fe/downloaded_packages’

Any suggestions on how to get 'stringi' to install? I'm not real familiar with the error output. Should I just try to go back to older versions of R and Rstudio? Ultimately I'm worried that this will be the tip of the iceberg in terms of packages now not working with the updated R

oh and:

 > sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-apple-darwin10.8.0 (64-bit)
Running under: OS X 10.7.5 (Lion)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

loaded via a namespace (and not attached):
[1] plyr_1.8.3   tools_3.2.1  gtable_0.1.2 Rcpp_0.11.6  grid_3.2.1  digest_0.6.8 proto_0.3-10
like image 933
Kodiakflds Avatar asked Jun 24 '15 23:06

Kodiakflds


3 Answers

I had the same problem. Marek's comment above, that install.packages is looking for the source instead of the binary because it's newer, was correct for me too. But his suggestion to use the "options" line didn't work for me for some reason. This, however, did work:

install.packages("stringi",type="mac.binary")

This is much easier than trying to install a compiler through Xcode to process the source package.

like image 140
robJ Avatar answered Nov 20 '22 11:11

robJ


You are victim of install.packages.check.source options which cause R to try install package from sources if sources are newer than binary. Which happens when package is updated (binaries shows up <72 after sources). Which was a case with stringi (look at messages you got: here is a binary version available but the source version is later).

I set

options(install.packages.check.source = "no")

in my .Rprofile file to not be worried by install.packages. All I need to do is wait for binaries to be compiled.

like image 33
Marek Avatar answered Nov 20 '22 10:11

Marek


I tried install.packages("stringi") and it caused my R Studio to stop recognizing the packages I had installed.

I solved it by running this command. Hope it helps:

install.packages("stringi", repos="http://cran.rstudio.com/", dependencies=TRUE)
like image 5
yl33 Avatar answered Nov 20 '22 11:11

yl33