Think I had done this type of command successfully before
sudo su c "R e \"install.packages('countrycode', repos='http://cran.rstudio.com/')\""
the screen reports
Installing package into '/usr/local/lib/R/site-library'
which is where other packages reside
I then get
downloaded 28kb
and it just says that the source packages are in a tmp folder before returning to the prompt
This should work,
sudo R -e "install.packages('countrycode', repos='http://cran.rstudio.com/')"
You will be asked to type in your password and then it starts downloading and installation ...
Related
I typed the following in the R command line:
install.packages("RecordLinkage")
I got the following error:
Warning in install.packages :
package ‘RecordLinkage’ is not available (for R version 3.1.0)
However, one of my coworkers did the exact same thing on the exact same version of R (3.1.0) and it worked. In addition, I've managed to install other packages successfully.
Any idea why this does not work? Any help would be greatly appreciated.
The package has been archived, so you will have to install from an archive.
I know this because the package home page at http://cran.r-project.org/web/packages/RecordLinkage/index.html tells me:
Package ‘RecordLinkage’ was removed from the CRAN repository.
Formerly available versions can be obtained from the archive.
Archived on 2015-05-31 as memory access errors were not corrected.
By following the link to archives (http://cran.r-project.org/src/contrib/Archive/RecordLinkage) I get a list of all old versions:
[ ] RecordLinkage_0.3-5.tar.gz 12-Sep-2011 18:04 688K
[ ] RecordLinkage_0.4-1.tar.gz 12-Jan-2012 09:39 676K
So now I know the version number of the most recent version. The way forward is to download the tarball, install all package dependencies and then install the package from the local downloaded file.
Try this:
# Download package tarball from CRAN archive
url <- "http://cran.r-project.org/src/contrib/Archive/RecordLinkage/RecordLinkage_0.4-1.tar.gz"
pkgFile <- "RecordLinkage_0.4-1.tar.gz"
download.file(url = url, destfile = pkgFile)
# Expand the zip file using whatever system functions are preferred
# look at the DESCRIPTION file in the expanded package directory
# Install dependencies list in the DESCRIPTION file
install.packages(c("ada", "ipred", "evd"))
# Install package
install.packages(pkgs=pkgFile, type="source", repos=NULL)
# Delete package tarball
unlink(pkgFile)
Note:
This will only work if you have the build tools installed on your machine. On Linux this will be the case. But on Windows you will have to install RTools if you don't have it already. And on OS X (Mac) you will have to install XCode and the associated command line tools.
Also this solution from the Rstudio blog
require(devtools)
install_version("ggplot2", version = "0.9.1", repos = "http://cran.us.r-project.org")
https://support.rstudio.com/hc/en-us/articles/219949047-Installing-older-versions-of-packages
If using Rstudio, select "install from Package Archive File(.zip;.tar.gz)" in "Install Packages" window.
On linux this is simply:
sudo su - -c "R -e \"devtools::install_url('https://cran.r-project.org/src/contrib/RecordLinkage_0.4-10.tar.gz')\""
I typed the following in the R command line:
install.packages("RecordLinkage")
I got the following error:
Warning in install.packages :
package ‘RecordLinkage’ is not available (for R version 3.1.0)
However, one of my coworkers did the exact same thing on the exact same version of R (3.1.0) and it worked. In addition, I've managed to install other packages successfully.
Any idea why this does not work? Any help would be greatly appreciated.
The package has been archived, so you will have to install from an archive.
I know this because the package home page at http://cran.r-project.org/web/packages/RecordLinkage/index.html tells me:
Package ‘RecordLinkage’ was removed from the CRAN repository.
Formerly available versions can be obtained from the archive.
Archived on 2015-05-31 as memory access errors were not corrected.
By following the link to archives (http://cran.r-project.org/src/contrib/Archive/RecordLinkage) I get a list of all old versions:
[ ] RecordLinkage_0.3-5.tar.gz 12-Sep-2011 18:04 688K
[ ] RecordLinkage_0.4-1.tar.gz 12-Jan-2012 09:39 676K
So now I know the version number of the most recent version. The way forward is to download the tarball, install all package dependencies and then install the package from the local downloaded file.
Try this:
# Download package tarball from CRAN archive
url <- "http://cran.r-project.org/src/contrib/Archive/RecordLinkage/RecordLinkage_0.4-1.tar.gz"
pkgFile <- "RecordLinkage_0.4-1.tar.gz"
download.file(url = url, destfile = pkgFile)
# Expand the zip file using whatever system functions are preferred
# look at the DESCRIPTION file in the expanded package directory
# Install dependencies list in the DESCRIPTION file
install.packages(c("ada", "ipred", "evd"))
# Install package
install.packages(pkgs=pkgFile, type="source", repos=NULL)
# Delete package tarball
unlink(pkgFile)
Note:
This will only work if you have the build tools installed on your machine. On Linux this will be the case. But on Windows you will have to install RTools if you don't have it already. And on OS X (Mac) you will have to install XCode and the associated command line tools.
Also this solution from the Rstudio blog
require(devtools)
install_version("ggplot2", version = "0.9.1", repos = "http://cran.us.r-project.org")
https://support.rstudio.com/hc/en-us/articles/219949047-Installing-older-versions-of-packages
If using Rstudio, select "install from Package Archive File(.zip;.tar.gz)" in "Install Packages" window.
On linux this is simply:
sudo su - -c "R -e \"devtools::install_url('https://cran.r-project.org/src/contrib/RecordLinkage_0.4-10.tar.gz')\""
By installing the package in R using the following command:
install.packages('FILE_PATH', repos=NULL, type = "source")
I got the following error:
Installing package into ‘/home/p/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Errore in rawToChar(block[seq_len(ns)]) :
embedded nul in string: 'PK\003\004\024\0\002\0\b\0]\xadVCr\xcb\xea\xfcR\0\0\0\xa7\0\0\0\027\0\0\0bivpois-Rcode/.Rhistory+\xce/-JN\xd5PO\xca,+\xc8\xcf,\xd6+IL\xcaI\xd5\vR\xd7\xe4\xe5*\x86J\xe5\xe4\xea%\025`\b\xa5d\xa2\v楖\xe7%\xe6'
Warning message:
In install.packages("/home/p/Research/14_bivpois-Rcode.zip", repos = NULL, :
installation of package ‘/home/p/Research/14_bivpois-Rcode.zip’ had non-zero exit status
The R version is the 3.0.2 (2013-09-25) -- "Frisbee Sailing" and the OS is Linux Mint (UNIX).
Why Do I get that error and what does it mean:
installation of package ‘/home/p/Research/14_bivpois-Rcode.zip’ had non-zero exit status
in R?
You can find the package here and the file 14_bivpois-Rcode.zip is the source.
I tried to install that locally and the path is the correct one.
Any suggestion to install that package in UNIX?
Simple install following libs on your linux.
curl: sudo apt-get install curl
libssl-dev: sudo apt-get install libssl-dev
libcurl: sudo apt-get install libcurl4-openssl-dev
xml2: sudo apt-get install libxml2-dev
The .zip file provided by the authors is not a valid R package, and they do state that the source is for "direct use" in R (by which I assume they mean it's necessary to load the included functions manually). The non-zero exit status simply indicates that there was an error during the installation of the "package".
You can extract the archive manually and then load the functions therein with, e.g., source('bivpois.table.R'), or you can download the .RData file they provide and load that into the workspace with load('.RData'). This does not install the functions as part of a package; rather, it loads the functions into your global environment, making them temporarily available.
You can download, extract, and load the .RData from R as follows:
download.file('http://stat-athens.aueb.gr/~jbn/papers/files/14/14_bivpois_RDATA.zip',
f <- tempfile())
unzip(f, exdir=tempdir())
load(file.path(tempdir(), '.RData'))
If you want the .RData file to be available in the current working directory, to be loaded in the future, you could use the following instead:
download.file('http://stat-athens.aueb.gr/~jbn/papers/files/14/14_bivpois_RDATA.zip',
f <- tempfile())
unzip(f, exdir=tempdir())
file.copy(file.path(tempdir(), '.RData'), 'bivpois.RData')
# the above copies the .RData file to a file called bivpois.RData in your current
# working directory.
load('bivpois.RData')
In future R sessions, you can just call load('bivpois.RData').
You can try using command : install.packages('*package_name', dependencies = TRUE)
For example is you have to install 'caret' package in your R machine in linux : install.packages('caret', dependencies = TRUE)
Doing so, all the dependencies for the package will also be downloaded.
For those of you who are using MacOS and like me perhaps have been circling the internet as to why some R packages do not install here is a possible help.
If you get a non-zero exit status first check to ensure all dependencies are installed as well. Read through the messaging. If that is checked off, then look for indications such as gfortran: No such a file or directory. That might be due to Apple OS compiler issues that some packages will not install unless you use their binary version. Look for binary zip file in the package cran.r-project.org page, download it and use the following command to get the package installed:
install.packages("/PATH/zip file ", repos = NULL, type="source")
Did you check the gsl package in your system. Try with this:
ldconfig-p | grep gsl
If gsl is installed, it will display the configuration path. If it is not in the standard path /usr/lib/ then you need to do the following in bash:
export PATH=$PATH:/your/path/to/gsl-config
If gsl is not installed, simply do
sudo apt-get install libgsl0ldbl
sudo apt-get install gsl-bin libgsl0-dev
I had a problem with the mvabund package and this fixed the error
Cheers!
I was having a similar problem trying to install a package called AED. I tried using the install.packages() command:
install.packages('FILE_PATH', repos=NULL, type = "source")
but kept getting the following warning message:
Warning message:
In install.packages("/Users/blahblah/R-2.14.0/AED", :
installation of package ‘/Users/blahblah/R-2.14.0/AED’ had
non-zero exit status
It turned out the folder 'AED' had another folder inside of it that hadn't been uncompressed. I just uncompressed it and tried installing the package again and it worked.
Try use this:
apt-get install r-base-dev
It will be help. After then I could makeinstall.packages('//package_name')
I have had the same problem with a specific package in R and the solution was I should install in the ubuntu terminal libcurl.
Look at the information that appears above explaining to us that curl package has error installation.
I knew this about the message:
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
* rpm: libcurl-devel (Fedora, CentOS, RHEL)
* csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
To install it I used the net command:
sudo apt-get install libcurl4-openssl-dev
Sometimes we can not install a specific package in R because we have problems with packages that must be installed previously as curl package. To know if we should install it we should check the warning errors such as: installation of package ‘curl’ had non-zero exit status.
I hope I have been helpful
I had the same problem, but the answer from #little_chemist helped me sorting it out. When installing packages from a file in a unix OS (Ubuntu 18.04 for me), the file can not be zipped. You are using:
install.packages("/home/p/Research/14_bivpois-Rcode.zip", repos = NULL, type="source")
I noticed the solution was as simple as unzipping the package. Additionally, unzip all (installation related?) packages inside, as #little_chemist points out. Then use install.packages:
install.packages("/home/p/Research/14_bivpois-Rcode", repos = NULL, type="source")
Hope it helps!
It took a good amount of time to install RMySQL on my Linux machine but I was able to install it after changing environment variables and copy and paste lib.dll file.
However, I'm now trying to install RMySQL on my 64bit window machine, but so far there's no progress yet for two days. It broke down after "running command sh ./configure.win had status 127 error, and I cannot find what this means.
Can anyone shed some lights on this?
install.packages('RMySQL',type='source')
Installing package into ‘C:/Users/chu/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/RMySQL_0.9-3.tar.gz'
Content type 'application/x-gzip' length 165363 bytes (161 Kb)
opened URL
downloaded 161 Kb
* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
Warning: running command 'sh ./configure.win' had status 127
ERROR: configuration failed for package 'RMySQL'
* removing 'C:/Users/chu/Documents/R/win-library/3.1/RMySQL'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\chu\Documents\R\win-library\3.1" C:\Users\chu\AppData\Local\Temp\RtmpKA9e7I/downloaded_packages/RMySQL_0.9-3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘RMySQL’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\chu\AppData\Local\Temp\RtmpKA9e7I\downloaded_packages’
for linux users..
install- libmysql first
sudo apt-get install libmysql++-dev
then try.
I was facing the same error. Given below is the link to a way around that worked for me.
http://www.ahschulz.de/2013/07/23/installing-rmysql-under-windows/
In short, the location of library libmysqll.dll required for compilation, had to be changed from lib folder to bin folder of the home directory set for MySQL in environment variables.
By default, R uses the /tmp directory to install packages. On security conscious machines, the /tmp directory is often marked as “noexec” in the /etc/fstab file. This means that no file under /tmp can ever be executed. Packages that require compilation or that have self-inflating data will fail with the error mentioned.
The solution is to set the TMPDIR environment variable outside R (in your shell), which R will use as the compilation directory. How to do this depends on the shell. bash:
mkdir ~/tmp
export TMPDIR=~/tmp
Then R can compile and install the package.
I ran into the same problem while updating packages on Windows server for latest version of R. I solved it by installing from a .zip file vs .tar.gz.
I actually had to go through the process of first downloading the package, and then installing from it (not from mirror) for other reasons.
Here is what it looked like:
pk <- 'caTools'
download.packages(pk, "R-3.2-packages/" ,type = "win.binary")
install.packages(
dir("R-3.2-packages/",pattern=pk,full.names = TRUE),
repos = NULL,
type = "source")
Hope this helps.
Solution if anyone faced the same problem on windows:
Make sure your MYSQL_HOME environment variable is set correctly and libmysql.dll is copied to bin folder!!!
Run install.packages('RMySQL') then when the "Do you want to install from sources..." window pops up select No.
Then copy the downloaded binary packages location from console.
Go to Packages -> Install, paste the location into Package archive and click Install.
I am trying to install the packages rpanel and tkrplot on RStudio. After downloading and installing there I got this message:
downloaded 686 Kb
* installing *source* package ‘rpanel’ ...
** package ‘rpanel’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** preparing package for lazy loading
Error in structure(.External(.C_dotTcl, ...), class = "tclObj") :
[tcl] can't find package BWidget.
Error : unable to load R code in package ‘rpanel’
ERROR: lazy loading failed for package ‘rpanel’
* removing ‘..../R/i686-pc-linux-gnu-library/3.0/rpanel’
Warning in install.packages :
installation of package ‘rpanel’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp1MdC0f/downloaded_packages’
I already installed BWidget on my own, but it didn't help.
Anyone any ideas about this problem and maybe can help me?
The system is Ubuntu 12.04.
Under windows 7 there is no problem and everything is working fine.
There are easier ways to install BWidgets. On my mac with Macports I did:
sudo port install BWidget
On Ubuntu you can probably install it with apt-get:
sudo apt-get install bwidget
"Stumbled across this while looking for an answer to the same question. Like an unfortunate number of library authors, the BWidgets people have assumed that the only people who need to use their libraries are planning to code with them. For those of us who've never used TCL, the installation instructions mean nothing.
From the a document called tuto-install-tkabber on the tkabber.jabber.ru website (irritating spam catcher won't let me post a URL), the answer is:
Install the BWidgets directory into the "lib" directory returned by:
whereis tcl
It should look something like: /usr/lib/tcl8.4"
from http://www.linuxquestions.org/questions/linux-software-2/where-to-install-bwidget-tcl-98583/ did the trick for me
Also I got BWidget from: http://sourceforge.net/projects/tcllib/files/BWidget/1.7.0/BWidget-1.7.0.zip/download
#Calimo's answer worked for me on Linux Mint 18.3 RStudio R 3.6.0. I would have commented in #Calimo's thread except for the stupid 50 reputation limit.
sudo apt-get install bwidget
Also works for Ubuntu 18 R 3.4.4 but if you get an X11 issue with rgl then this helped from #Ouistiti.
I had similar issues trying to get biotools working in Rstudio (on Ubuntu 16.04), where rpanel and tkrplot are required. Even after installing Bwidget per Calimo's answer, I got the error installation of package ‘tkrplot’ had non-zero exit status because tk.h: No such file or directory. If you look in the directory, this error is definitely correct. You need to get tk.h in there. I found out how to do so elsewhere on stackexchange:
Install tcl-dev package using apt or synaptic; tcl contains the
runtime, while tcl-devel contains header and development files. Do the
same with tk-dev
from:
https://stackoverflow.com/a/9649478/10405322
Thus,
sudo apt-get install tcl-dev
sudo apt-get install tk-dev
download BWidget from
http://sourceforge.net/project/showfiles.php?group_id=12883
once you get the archive BWidget-1.7.0.tar.gz move it to /usr/local/lib and install it with following code in terminal:
sudo mv /some_download_path/BWidget-1.7.0.tar.gz /usr/local/lib
cd /usr/loca/lib
sudo tar zxf BWidget-1.7.0.tar.gz
ok, done.