PARTY Package Installation Failure and Error Messages - r

I am new to R (so your patience and support is appreciated)! I looked up this issue, but still could not find a solution that worked. I am trying to install the "party" package in R. However, I keep receiving the following error messages:
> **ld: warning: directory not found for option**
> '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2' ld: **library not
> found for -lgfortran** clang: error: linker command failed with exit
> code 1 (use -v to see invocation) make: *** [party.so] Error 1 ERROR:
> compilation failed for package ‘party’
> * removing ‘/Users/md3389/Library/R/3.3/library/party’ **Warning in install.packages : installation of package ‘party’ had non-zero exit
> status**
>
> The downloaded source packages are in
> ‘/private/var/folders/fw/wxx2bzj51f7c7p6ptk_g1tyw0000gn/T/RtmpmZHUu9/downloaded_packages’
I successfully installed "mvtnorm" and "multcomp" as suggested on a similar thread here: [Error installing PARTY package in R
However, I still could not install PARTY, so I checked this thread: error install packages("party") - R studio IDE
The above thread led me to https://www.r-bloggers.com/installing-r-on-os-x/
However, I am wondering if there is a more simple solution that does not require me downloading additional software that will force me to update my version of Mac OS X to 10.13.6 or later. I currently have OS X Yosemite (version 10.10.5) and am nervous about updating, since I have heard mixed reviews.
Could someone please advise? I am trying to install "party" for a course assignment, and the "non-zero exit status" and "ld" warnings should not be what I am wasting time on! :-(
Thank you so much!

Related

rgdal not installing in R? "non-zero exit status?"

I am trying to install the package rgdal on a new MacOS 12.2.1. I have the newest version of R, and it has not been working much to my frustration. When I use the command "install.packages("rgdal")," a prompt is displayed: "Do you want to install from sources the package which needs compilation? (Yes/no/cancel)" I've tried this multiple times, selecting both yes and no, because I really have no idea what this prompt even means. Anyways, R downloads a bunch of necessary packages with no problem, but then when it gets to the end of the downloading process, this displays:
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/rgdal’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/rgdal’
The downloaded source packages are in
‘/private/var/folders/t5/dqf_shjn2v79xfnycl1thkxh0000gn/T/Rtmpz3gATu/downloaded_packages’
Warning message:
In install.packages("rgdal") :
installation of package ‘rgdal’ had non-zero exit status
I have no idea what this means! I'm tired, confused, upset, I have little experience with coding at all and yeah this is just not an ideal situation! If anyone with more experience with R understands what is happening, I'd love help!
Thank you!

Sentiment Analysis using R: github 'okugami79/sentiment140' package installation error

I wish to install sentiment140 github package by developer okugami79. I wrote following script for the same:
install.packages("githubinstall")
require(devtools)
library(githubinstall)
install_github('sentiment140', 'okugami79')
library(sentiment)
But it threw an error:
Installation failed: Failed to connect to raw.githubusercontent.com port 443: Timed out
Warning message: Username parameter is deprecated. Please use okugami79/sentiment140
Then I modified installation statement as follows:
install_github('okugami79/sentiment140')
Still it threw an error:
Installation failed: Failed to connect to raw.githubusercontent.com port 443: Timed out
I checked for solution on stackoverflow through following link:
Timeout R package installation from Github
Here, I found a way to install github package by downloading package zip file and installing it in R using:
install.packages("/address/to/zip-package", repos = NULL, type="source")
This also prompts error:
Warning: invalid package 'sentiment-master'
Error: ERROR: no packages specified
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\u257449\Documents\R\win-library\3.3" "sentiment-master"' had status 1
Warning in install.packages : installation of package ‘sentiment-master’ had non-zero exit status
How should I go about installing required package from github in R ? Your valuable advice/solution is requested.
Thank You !
Just a straightforward pair of functions installed this package from Github source for me on both Windows and OSX.
install.packages("devtools")
devtools::install_github('okugami79/sentiment140')
There may be something unusual about your system setup, in which case, it would be helpful to have your session information. You can get that by entering sessionInfo().
However, note that this package you are looking to install is over 4 years old per the description file on Github. A lot of work has gone into other packages that work with natural language processing and sentiment analysis. The CRAN Task View for Natural Language Processing is a good place to start for an overview of many of these packages that can be installed directly from CRAN. There are many resources that are better maintained. For example, here's a chapter on sentiment analysis using the tidytext package.

How to install R-packages not in the conda repositories?

I am using Anaconda to manage my R-installation. It works great for packages available in the R-channels provided by Anaconda, but I am having troubles installing packages not contained in the Anaconda repos.
I have tried a few different approaches, all listed below together with their error output.
1. install.packages('rafalib')
Suggested to work here conda - How to install R packages that are not available in "R-essentials"?. My .libPaths() points to '/home/user/anaconda2/lib/R/library'.
Out:
--- Please select a CRAN mirror for use in this session ---
Error in download.file(url, destfile = f, quiet = TRUE) :
unsupported URL scheme
Error: .onLoad failed in loadNamespace() for 'tcltk', details:
call: fun(libname, pkgname)
error: Can't find a usable init.tcl in the following directories:
/opt/anaconda1anaconda2anaconda3/lib/tcl8.5 ./lib/tcl8.5 ./lib/tcl8.5 ./library ./library ./tcl8.5.18/library ./tcl8.5.18/library
This probably means that Tcl wasn't installed properly.
I installed tcl from the conda channel r-old, but install.packages() still threw the same error message.
2. options(menu.graphics=FALSE) and then install.packages('rafalib')
I got a list of mirrors and chose one.
Out:
Selection: 15
trying URL 'http://cran.utstat.utoronto.ca/src/contrib/rafalib_1.0.0.tar.gz'
Content type 'application/x-gzip' length 11798 bytes (11 KB)
==================================================
downloaded 11 KB
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
The downloaded source packages are in
‘/tmp/Rtmphwpta0/downloaded_packages’
Warning message:
In install.packages("rafalib") :
installation of package ‘rafalib’ had non-zero exit status
Both 2 and 3 are from Disable/suppress tcltk popup for CRAN mirror selection in R
3. Setting the mirror in ~/.Rprofile
Before trying install.packages(), I added the following to my ~/.Rprofile.
## Default repo
local({r <- getOption("repos");
r["CRAN"] <- "http://cran.us.r-project.org";
options(repos=r)})
Out:
trying URL 'http://cran.us.r-project.org/src/contrib/rafalib_1.0.0.tar.gz'
Content type 'application/x-gzip' length 11798 bytes (11 KB)
==================================================
downloaded 11 KB
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
The downloaded source packages are in
‘/tmp/RtmppIz9rT/downloaded_packages’
Warning message:
In install.packages("rafalib") :
installation of package ‘rafalib’ had non-zero exit status
4. Setting the download method to 'curl' or 'wget'.
While keeping the new ~/.Rprofile configuration. I guess this wasn't necessary since the package seems to be downloading fine now, but I tested it just in case.
Out:
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
Warning in download.packages(pkgs, destdir = tmpd, available = available, :
download of package ‘rafalib’ failed
Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
download had nonzero exit status
5. Manual download of rafalib
install.packages('../Downloads/rafalib_1.0.0.tar.gz', repos=NULL, type='source')
Out:
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
Warning message:
In install.packages("../Downloads/rafalib_1.0.0.tar.gz", repos = NULL, :
installation of package ‘../Downloads/rafalib_1.0.0.tar.gz’ had non-zero exit status
6. Building a conda package from rafalib
I opened a separate issue for this Errors building R-packages for conda. In short, it complains about missing dependencies that I already have installed. Update I got a round the dependency problem and I am now stuck at the same rl_signal_event_hook-error as for my other approaches.
7. sudo ln /usr/lib/libncursesw.so.6 /usr/lib/libncursesw.so.5
As per https://github.com/conda/conda/issues/1679, but it didn't fix the issue for me.
So it seems like I can now download the package fine, but installing it fails. I have seen the error message sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook previously when using R with irkernel in the Jupyter Notebook, but it has never obstructed my work. I have never seen anything relating to that error message when running python through anaconda.
I'm out of ideas. Does anyone know how I can install R-packages not provided by anaconda, such as rafalib or swirl?
I am on Linux (Antergos, an Arch derivative) with kernel 4.4.5-1-ARCH.
UPDATE 2016/04/15
There is some related discussion in this thread. I have tried to get around this error by installing different versions of ncurses, including this patched version, and I have tried to link the readline libraries, as suggested here, but I keep running into the same error. I'm quite lost at this point and any help to solve this would be greatly appreciated.
Detailed post on managing packages that are and are not in Anaconda R: http://ihrke.github.io/conda.html
Essentially is using commands:
conda skeleton cran <package_name>
conda build <package_name>
If the package has dependencies that are also not in Anaconda:
conda skeleton cran <dependency1>
conda skeleton cran <dependency2>
conda build <package_name>
Essentially I would agree with this post in saying that I don't understand how install.packages() works with Anaconda. What I seem to see is that Anaconda creates a R environment where all the packages installed from install.packages() are kept.
Whenever I am working in Jupyter with R, I use this environment and am able to access all the packages that I have installed with install.packages()
In the end, I got around the rl_event_hookproblems by following the approach recommended here and symlinking anaconda's libreadline to the system one:
mv ~/anaconda3/lib/libreadline.s.6.2 ~/anaconda3/lib/libreadline.s.6.2.bak
ln -s /usr/lib/libreadline.so.6.3 ~/anaconda3/lib/libreadline.s.6.2
I am still having troubles installing some dependency heavy R-packages due to failure to load shared objects when using install.packages() from withing R. However, simpler packages work fine and I can get most of the dependency heavy packages from anacondas R-repositories.

Having trouble installing RODBC for R, clang: error:?

I just started working through R for everyone and I'm having trouble installing the RODBC package. I've seen that a lot of other people have had trouble doing this on Macs as well. (I'm currently running 10.10.5 Yosemite.)
Originally I was having trouble with the program finding the sql.h and sql.ext headers, but I've finally managed to work through that.
Now, however, when I run
install.packages("RODBC")
or
install.packages("~/Downloads/RODBC_1.3-12.tar", repos = NULL, type = "source"),
I get this:
clang: error: no such file or directory: '/usr/local/lib/libcairo.a'
clang: error: no such file or directory: '/usr/local/lib/libpixman-1.a'
clang: error: no such file or directory: '/usr/local/lib/libfreetype.a'
clang: error: no such file or directory: '/usr/local/lib/libfontconfig.a'
clang: error: no such file or directory: '/usr/local/lib/libreadline.a'
make: *** [RODBC.so] Error 1
ERROR: compilation failed for package ‘RODBC’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/RODBC’
Warning in install.packages :
installation of package ‘/Users/John/Downloads/RODBC_1.3-12.tar’ had non-zero exit status
And I've come to an impasse. I can't seem to find much in the way of advice on getting through this and I really don't understand what it means. I could really use some help!
I had the same problem while using Microsoft R Open 3.2.4, in OSX 10.11.6.
To solve it I just did brew install cairo.
After that I got a different error:
clang: error: no such file or directory: '/usr/local/lib/libreadline.a'
This was solved with brew link --force readline.
I then went again with install.packages("RODBC",type = "source"), and it worked for me.

Install R package: UScensus2010blk for windows

Did anyone tried to install R package: UScensus2010blk on your own PC?
I tried to use from UScensus2010:
install.blk ("windows")
It gives an error saying "Not Available Yet"
I downloaded the package myself (4.2GB!) and tried to install from local and I still get error messages:
installing source package 'UScensus2010blk' ...
** data
Warning in file.copy(files, is, TRUE) :
problem copying data\montana.blk10.rda to Q:\LCVDJ\R\R-3.0.2\library\UScensus2010blk\data\montana.blk10.rda: Invalid argument
...
(the error message repeats for different states)
...
** help
Error in lazyLoadDBinsertListElement(from, i, datafile, ascii, compress, :
write failed
ERROR: installing Rd objects failed for package 'UScensus2010blk'
* removing 'Q:/LCVDJ/R/R-3.0.2/library/UScensus2010blk'
Warning in install.packages :
running command '"Q:/LCVDJ/R/R-30~1.2/bin/i386/R" CMD INSTALL -l "Q:\LCVDJ\R\R-3.0.2\library" "C:/Users/n1304/Downloads/UScensus2010blk_1.00.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘C:/Users/n1304/Downloads/UScensus2010blk_1.00.tar.gz’ had non-zero exit status
Does anyone have any idea why my installation is failed? I'm using R-3.0.2
Thanks!
There's an error in the census2010 package. The functions install.tract, install.blk, install.blkgrp, install.county, and install.cdp are supposed to check for R version >= 2.11 if you call the functions with the "windows" argument, but they only check the minor version so if you have R version 3.0 through 3.10 they incorrectly report an error.
To work around this error, you should be able to run
install.packages('UScensus2010blk', repos='http://lakshmi.calit2.uci.edu/census2000/R/', type='source')
instead of
install.blk('windows')
I tried to install it, and received the same message. It appears to be a problem with all the "windows" installations, as the command install.blk("linux") is functional.

Resources