install.packages() in R - r

I am trying to install an R package from its source file. The package could be installed only on R.2.9.2. So I uninstall my new version of R, installed the mentioned version and tried to install package like this:
install.packages(pathToPackage, repos="NULL", type="source")
But I am receiving this error:
argument 'lib' is missing: using 'C:\Users\hora\Documents/R/win-library/2.9'
Warning: unable to access index for repository NULL/src/contrib
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘c://Users//hora//Downloads//affymicro.zip’ is not available
What is the solution? Thank you in advance.

Related

Is there any way to install RMongo package as its officially removed from CRAN?

I need to install RMongo to connect to my local MongoDB database. On installing RMongo I am getting this error:
Warning in install.packages :
package ‘RMongo’ is not available (for R version 3.5.3)
I also downloaded RMongo tar file and stored in R directory where all packages get installed and tried to install the package by writing this command in R environment
install.packages("C:/Users/Akash/Documents/R/win-library/3.5/RMongo_0.0.25.tar", repos = NULL, type="source")
On trying to download the package through tar file I am getting this error,
Warning: invalid package 'C:/Users/Akash/Documents/R/win-library/3.5/RMongo_0.0.25.tar'
Error: ERROR: no packages specified
In R CMD INSTALL
Warning in install.packages :
installation of package ‘C:/Users/Akash/Documents/R/win-library/3.5/RMongo_0.0.25.tar’ had non-zero exit status
Any help is appreciated
Thanks in Advance

R package installation error: no package called ‘org.Hs.eg.db’

I am trying to install this package http://bioconductor.org/packages/release/data/annotation/html/org.Hs.eg.db.html. When I try to load org.Hs.eg.db using library (org.Hs.eg.db) , gives me this
error: Error in library(org.Hs.eg.db) :
there is no package called ‘org.Hs.eg.db’
It says the packages are downloaded here:
The downloaded source packages are in
‘/tmp/Rtmpgy1ZJE/downloaded_packages’
What could be the reason for this?
If you run into this error nowadays you have to install the package using
BiocManager::install("org.Hs.eg.db")

Issue installing rJava on aix7.1.3

I have installed the 32bit version of R 3.1.1 on AIX 7.1.3
I am in the step of installing the rJava package from the R shell using the command: install.packages("rJava")
However, I am getting this error:
Warning: unable to access index for repository http://cran.utstat.utoronto.ca/src/contrib
Warning messages:
1: In open.connection(con, "r") : unable to resolve 'cran.r-project.org'
2: package 'rJava' is not available (for R version 3.1.1)
It seems that R is unable to connect to the internet to download the package.
I have tried several mirror sites.
Any idea how to resolve this issue in AIX?
Is there also an alternative option to install rJava manually not through the install.packages() R command?
You could try to compile the package with devtools:
install.packages('devtools')
devtools::install_github('s-u/rJava')
Make sure to have the correct javac in your path.

Causes of "Error: package '_____' was built before 3.0.0: please re-install it" in R

On one computer running R 2.15.2 I have installed packages from a .zip file (these packages happened to be ggplot2 and data.table, but I don't think the specific package is my issue.) Everything works fine. I took these packages to a computer without an internet connection and installed them. This other computer is running R 3.0.1. The packages seemed to install without a problem (using R's "install package(s) from local zip file" option). When I call the packages with the library(), I get the following error:
Error: package '<insert name of newly installed package here>' was build before 3.0.0: please-re-install it
Can anyone explain potential causes for this error to be thrown? Are there particular directories that the .zip packages must be in for a proper install? If R is installed on a separate partition from where the .zip packages were loaded, could this cause the error?
I'm at a loss, any pointers are greatly appreciated. This is a difficult one to reproduce; if you need any other version/system parameters to understand the problem, please don't hesitate to ask.
I found this solution while look at GitHub ggplot2 issue #796
update.packages(checkBuilt = TRUE, ask = FALSE)
It will update all the packages that need to be reinstalled.
Running install.packages("codetools") can fix this issue for R 3.0.2, if you have the same problem like me:
installing to /home/user/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/libs
** R
** inst
** preparing package for lazy loading
Error : package ‘**codetools**’ was built before R 3.0.0: please re-install it
Error : unable to load R code in package ‘Rcpp’
ERROR: lazy loading failed for package ‘Rcpp’
I installed shiny according https://github.com/rstudio/shiny-server/wiki/Ubuntu-step-by-step-install-instructions
and got the same error at the step
sudo su - -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\""
Warning messages:
1: In install.packages("shiny", repos = "http://cran.rstudio.com/") :
installation of package ‘Rcpp’ had non-zero exit status
2: In install.packages("shiny", repos = "http://cran.rstudio.com/") :
installation of package ‘httpuv’ had non-zero exit status
3: In install.packages("shiny", repos = "http://cran.rstudio.com/") :
installation of package ‘shiny’ had non-zero exit status
I tried the answer by Richard Lee by starting R
R
and got the error
Warning in install.packages("shiny") :
'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead? (y/n) n
Error in install.packages("shiny") : unable to install packages
obviously no write permission, so
sudo R
Now I tried again
install.packages("shiny")
and got a number of errors
Error : package ‘codetools’ was built before R 3.0.0: please re-install it
Error : package ‘RJSONIO’ was built before R 3.0.0: please re-install it
Error : package ‘caTools’ was built before R 3.0.0: please re-install it
Error : package ‘bitops’ was built before R 3.0.0: please re-install it
Error : package ‘digest’ was built before R 3.0.0: please re-install it
Error : package ‘xtable’ was built before R 3.0.0: please re-install it
Each time I got an error, I re-installed the requested package
install.packages("codetools")
install.packages("RJSONIO")
etc.
and eventually, I was able to install Rccp, httpuv, and even shiny.
Now it works!!
Also see
Shiny package installation on R version 3.0.2 "Frisbee Sailing"
I am using rkward on precise
I had a similar error using rkward. Specifically this one:
'lib = "/usr/local/lib/R/site-library"' is not writable
I temporarily changed the permissions for this directory so that rkward could run this from its console:
update.packages(checkBuilt = TRUE, ask = FALSE)
all to fix this:
Error: package '' was build before 3.0.0: please-re-install it
so that (sigh...) I could fix 'default' configuration for audio on precise. I couldn't use play() etc. in rkward.
That just needed phonon-backend-gtstreamer
I tried to install swirl on R(v3.1.0) on ubuntu 12.04LTS:
sudo R
install.packages("swirl")
But faced a similar error:
Error : package ‘codetools’ was built before R 3.0.0: please re-install it
Error : unable to load R code in package ‘httr’
ERROR: lazy loading failed for package ‘httr’
* removing ‘/usr/local/lib/R/site-library/httr’
ERROR: dependencies ‘testthat’, ‘httr’ are not available for package ‘swirl’
* removing ‘/usr/local/lib/R/site-library/swirl’
Doing following helped me:
install.packages('codetools')
install.packages("swirl")
library("swirl")
swirl()
| Welcome to swirl! Please sign in. If you've been here before, use the same
| name as you did then. If you are new, call yourself something unique.
What shall I call you?
I hope the same may help fix your installation issue.
Here is the work-around that I used:
I installed the latest version of R on an internet-capable computer. I then loaded the my required packages (Packages->install packages->select mirror->select package...
After R is finished installing, it displays a message of where the temporary .zip package is located. I navigated to this location, grabbed the temp package, and burnt it to a cd.
In this way, I could get the newer package build onto a computer without internet access. I would still be interested to know if there is an easy way to rebuild a package downloaded on an early R version to make it compatible with the latest version (without needed an internet connection).
Thanks for pointing me in the right direction #JoshuaUlrich

How to install the fftw3 package of R in ubuntu 12.04?

I am trying to install the fftw3 package through R console
>install.packages("fftw")
After this command it is asking to select the cran mirror.I have selected the cran mirror then following error occurs:
Loading Tcl/Tk interface ... done
Warning: unable to access index for repository http://ftp.iitm.ac.in/cran/src/contrib
Warning messages:
1: In open.connection(con, "r") :
unable to connect to 'cran.r-project.org' on port 80.
2: In getDependencies(pkgs, dependencies, available, lib) :
package ‘fftw’ is not available (for R version 2.14.1)
And When I am trying for fftw3 then following error occurs:
> install.packages("fftw3")
Installing package(s) into ‘/root/R/x86_64-pc-linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://ftp.iitm.ac.in/cran/src/contrib
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘fftw3’ is not available (for R version 2.14.1)
Can anyone help me out of this?
As Paul said, that's probably not an R package. There is an R package that is a wrapper for the FFTW library, also called fftw, you should install that:
Link to CRAN page of fftw
In Ubuntu you have then still the system requirement to have a proper installed fftw library, that you probably can solve via
sudo apt-get install fftw3 fftw3-dev pkg-config
The website you linked talks about a C library, there is nothing about an R code package. You mistakenly assume that R can install any .tar.gz file as an R library. An R library has a very specific structure of files and directories, and the error you get is because the .tar.gz does not adhere to this structure.

Resources