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

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.

Related

Unable to install Peaks package: package ‘Peaks’ is not available for this version of R [duplicate]

This question already has answers here:
How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?
(18 answers)
Closed 12 months ago.
I am working with series data and want to count the number of local 'maxima' and 'minima' (i.e. peaks and troughs/oscillations) along each series. I want to use the 'Peaks' package for this but only get the following error:
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
Warning in install.packages :
package ‘Peaks’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
As suggested I installed rtools without any problems but it still returned the same error when I tried installing 'Peaks'. I have not found any information at the cran.r-project link and have also tried to install findpeaks but got the same error. I am not actually sure what version I am running on my desktop (how do you check?); but I have tried it also on Rstudiocloud, which I think is the latest version (4.1.2).I have also tried:
findPeaks(MaxMn, thresh=0)
findValleys(MaxMn, thresh=0)
but R couldn't find the function. I'm a little confused about whether it is a package or function and what I need to do to make it happen. Any suggestions would be greatly appreciated.
Peaks vignette: https://www.rdocumentation.org/packages/splus2R/versions/1.3-3/topics/peaks
After installing Rtools, you need to put it on the system PATH so that R can find it while trying to build a package from its source code. It's highly likely that in your case Rtools is installed but not on the system path.
You can find the latest details on the process of installing rtools, adding to path and verifying installation is correct from Rtools page (https://cran.r-project.org/bin/windows/Rtools/rtools40.html).
The package is no longer available on CRAN: "Archived on 2019-04-18 as check problems were not corrected despite reminders."
From googling "R detect peaks", it looks like there are a number of current packages you might be able to use, including pracma and peakPick. In addition to CRAN, this also feels like something the Bioconductor repository may have packages for.

How to install an older version of the Wordcloud package [duplicate]

This question already has answers here:
Installing older version of R package
(8 answers)
Closed 6 years ago.
Quick question, I'm using an older version of R Studio - R 3.2.3 - and some newer packages require a newer version. Specifically, I want the wordcloud package, so is there a way to install an older version that is compatible with my version of R? I couldn't find a simple straight-to-the-point answer online and I'm on a bit of a time crunch since I need to create some wordclouds.
I'm using a Windows machine.
There are two ways you can install older packages in R.
Using devtools
Use the following code, updating the 2.2 with the version of wordcloud that you require.
require(devtools)
install_version("wordcloud", version = "2.2", repos = "http://cran.us.r-project.org")
Installing older packages from source
Equally you can install older packages directly from a URL as below.
wordcloudURL <- "https://cran.r-project.org/src/contrib/Archive/wordcloud/wordcloud_2.2.tar.gz"
install.packages(wordcloudURL, repos=NULL, type="source")
The URLs for older versions of wordcloud are available here.

get functions from old package [duplicate]

This question already has answers here:
extracting source code from r package
(2 answers)
Closed 8 years ago.
There are a number of packages that have functions I would like to use, however these packages are no longer maintained and were built for older R versions.
Using R 3.0.02 I get the following
install.packages("steepness")
Warning message:
package ‘steepness’ is not available (for R version 3.0.2)
Similarly using
packageurl <- "http://cran.r-project.org/src/contrib/Archive/steepness/steepness_0.2.tar.gz"
install.packages(packageurl, contriburl=NULL, type="source")
Warning message:
package ‘http://cran.r-project.org/src/contrib/Archive/steepness/steepness_0.2.tar.gz’ is not available (for R version 3.0.2)
and when i manually place the steepness folder in the win-library:
library(steepness)
Error: package ‘steepness’ was built before R 3.0.0: please re-install it
I only want a couple functions to save myself time rewriting everything from scratch. What is the best way round this? Can I just copy the source code for the two functions myself for example and define them myself? I have looked at the folder for the package but there is no obvious .r file to steal code from ONLY .rdb AND .rdx which are file formats I am not familiar with.
If you have some experience with defining functions in R you can just download the bundled *.tar.gz package from CRAN, look in the R folder of the unpacked package and extract the code you need.

Is Rgraphviz no longer available for R? [duplicate]

This question already has answers here:
How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?
(18 answers)
Closed 5 years ago.
I am running R version 3.0.1 in a 64 bit OS, and I have tried to install Rgraphviz 3 different ways:
1) I have used install.packages(Rgraphviz), but I get the error
Error in install.packages(Rgraphviz) : object 'Rgraphviz' not found
2) I have tried going through Packages > Install Packages in the R window, but I cannot find Rgraphviz
3) When I go through CRAN, at http://cran.r-project.org/web/packages/Rgraphviz/index.html, I get the message "Package ‘Rgraphviz’ was removed from the CRAN repository."
Does anyone know if there is any way I can get Rgraphviz, or if there is a suitable alternate?
You need to install it directly from the bioconductors site.
For R versions >= 3.5:
install.packages("BiocManager")
BiocManager::install("Rgraphviz")
For older R versions:
source("http://bioconductor.org/biocLite.R")
biocLite("Rgraphviz")
More info can be found here.
You just need to remember that the instruction install.packages requires you to enclose the package name between quotes, like this:
install.packages("Rgraphviz")

Install old package using install.packages [duplicate]

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.

Resources