Install old package using install.packages [duplicate] - r

This question already has answers here:
Installing older version of R package
(8 answers)
Closed 7 years ago.
I get
package ‘rJava’ is not available (for R version 2.15.0)
Warning: unable to access index for repository http://cran.stat.ucla.edu/bin/macosx/leopard/contrib/2.15
when using install.packages() if the repository does not have a version of the given package for my version of R, 2.15.0--the latest Mac binary. Is there a way to get R to check in for older versions, e.g. rJava for R 2.14?
I know that I could download the tar.gz file and then use R CMD INSTALL in terminal, but I was wondering if there was a way to do this using install.packages(). Thank you.

Try a different CRAN mirror repository (e.g. install.packages("rJava", repos = "http://cran.us.r-project.org/"), or simply try installing again with the UCLA repository. The CRAN mirror monitor report suggests there has been some sporadic downtime at the UCLA mirror recently. An Rjava binary for R 2.15.0 should be available. I can access it directly on the UCLA mirror at http://cran.stat.ucla.edu/bin/macosx/leopard/contrib/2.15/rJava_0.9-3.tgz .

You could install the old version of R, which has the compatible version of the package. If rJava is only available for 2.14, I'd just run that version.

Related

Error in installing gtools

I am fairly new to R. I have tried to google my question, and tried a few things, to no avail.
I am working on a MAC * High Sierra version 10.13.5
I am working with R * R version 3.5.0 (2018-04-23) -- "Joy in Playing"
I am unable to install the package "gtools", and I don't know what to do to make it work??
install.packages("gtools", type="source")
Warning: unable to access index for repository https://mirrors.sorengard.com/cran/src/contrib:
cannot open URL 'https://mirrors.sorengard.com/cran/src/contrib/PACKAGES'
Warning message:
package ‘gtools’ is not available (for R version 3.5.0)
I have also tried to install from a file saved on my computer, but this did not work either
library(gtools)
Error: package or namespace load failed for ‘gtools’:
package ‘gtools’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
You could try specifying a specific repository, for example:
install.packages("gtools", repos="https://cran.rstudio.com/")
Why are you using install from source? typically to install a package u only need to use the command
install.packages("gtools")
Then it will automatically ask u for a mirror to download from. It seems like "gtools" is available for R 3.5, so try to download it from another mirror and it should work.

Does install.packages update an already installed package in R?

When using install.packages() in R, does it uninstall the currently installed version of the package and install the latest version (even if the version number hasn't changed)?

Connecting to Oracle Database from R? [duplicate]

This question already has answers here:
Installation of RODBC/ROracle packages on OS X Mavericks
(4 answers)
Closed 8 years ago.
I have searched and it seems that RODBC or Roracle are used to connect to a oracle database within R.
However, both of these packages will not install for me in R 3.1.1....am I missing something? Is there a new/latest package that just came out that I should be using instead?
package ‘RODBC’ is available as a source package but not as a binary
Warning in install.packages :
package ‘RODBC’ is not available (for R version 3.1.1)
I am using Mac OSX 10.9.4. I tried using install.packages('RODBC').
I get that message when i use 3.1.1 so I toggled to 3.1.0 using R studio.
When I am using R 3.1.0 i get the message
Warning message:
package ‘RODBC’ was built under R version 3.1.2
The package does get installed and i am able to use the functions in the package just fine.

Error in installing packages from RStudio

I have been trying to install the package "doby" from RStudio (ver 0.98.501 ) on ubuntu 13.04 but it keeps throwing the following warning and the package does not get installed.
Warning in install.packages :
package ‘doBy’ is not available (for R version 2.15.2)
I have followed all the instructions given here :
http://www.r-bloggers.com/installing-r-packages/
Can someone please suggest where I might be going wrong ?
If you are on Ubuntu, please see this README for Ubuntu from CRAN --- it will allow you to get to the current version of R (today 3.0.2, in a few days 3.0.3) with mininal effort.
Once you have a current R version, getting the doBy package (which depends on it) installed is a piece of cake too.
If however you prefer to stay with your version of R, you can manually fetch an older version of doBy from its CRAN archive. Download to, say, /tmp and run R CMD INSTALLby hand on it.
From http://cran.r-project.org/web/packages/doBy/index.html, package doBy depends on R version 3.0 and above. Your R version is 2.15.2. You will need to install a later version of R, and then change the settings in Rstudio to target the updated version.

How do I install an older R package? [duplicate]

This question already has answers here:
Installing older version of R package
(8 answers)
Closed 7 years ago.
I am trying to install the R package bigrf using the following command:
install.packages('bigrf')
However, I receive this error:
Warning in install.packages: package 'bigrf' is not available (for R version 3.0.2).
I understand that the package was not built for R version 3.0.2, but is it not possible for me to install it regardless with the understanding that it might not have complete forward compatibility?
The safest thing to do would be to download the last version that the package was built for (link) and run the code on that version.
The easiest way to rebuild a package from source is using R-Studio.
They have a good walkthrough. You will need to use the devtools package as well.

Resources