Download older version of a package that has been removed from CRAN - r

I resume working on text mining after a substantial period of hiatus, but soon found out that the package RTextTools has been removed from CRAN and was no longer in maintenance. I tried to download it manually from CRAN archive using
url <- "http://cran.r-project.org/src/contrib/Archive/RTextTools/RTextTools_1.4.2.tar.gz"
install.packages(url, repos=NULL, type="source")
but my R shows
there is no package called 'RTextTools'.
I then tried out the trick recommended by this earlier thread by using
url <- "http://cran.r-project.org/src/contrib/Archive/RTextTools/RTextTools_1.4.2.tar.gz"
pkgFile <- "RTextTools_1.4.2.tar.gz"
download.file(url = url, destfile = pkgFile)
install.packages(c('randomForest', 'tree', 'ipred', 'maxent', 'glmnet', 'tau'))
install.packages(pkgs=pkgFile, type="source", repos=NULL)
But this didn't work either.
The RTextTools package has many handy features I appreciate and I really do want to maintain an older version of it in my folder, is there any other ways I can install the archived version of this package on my R?

The issue is located at the tree dependency package installation:
install.packages("tree")
Throws an error (my R version is 3.5.0):
ERROR: This is R version 3.5.0, 'tree' package requires R >= 3.6.0
In R CMD INSTALL
Warning in install.packages :
installation of package
‘tree_1.0-40.tar.gz’ had non-zero exit status
To solve it update R to version >= 3.6.0.

Related

Error while downloading "highcharter" package in r

I am trying to download "highcharter" but got the error below. I also tried installing "rjson" but I got "package ‘rjson’ is not available (for R version 3.6.3)" message
ERROR: dependency 'rjson' is not available for package 'highcharter'
* removing 'C:/Users/elif.gencaslan/Documents/R/win-library/3.6/highcharter'
Warning in install.packages :
installation of package ‘highcharter’ had non-zero exit status
The problem: Outdated R version
The latest version of rjson (0.2.21) depends on R version >= 4.0.0 (see CRAN), and it seems like you have R version 3.6.3.
Best solution: Update R
Your best option is to update your version of R before installing rjson or highcharter.
Alternatives: Install old version of rjson
An alternative is to install an older version of rjson (0.2.20 should work with your version of R).
You can either do this with packages like renv:
renv::install("rjson#0.2.20")
Or remotes:
remotes::install_version("rjson", "0.2.20")
Or you could download it and install it manually from this mran snapshot.

Package ‘Rstem’ is not available (for R version 3.5.1)

I am trying to install the Rstem package, but I am getting the message that there is no version available for the version of R 3.5.1. I'm using the macOs El Captain.
The error is:
> install.packages('Rstem', repos = 'https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz')
Installing package into ‘/Users/ls_rafael/Library/R/3.5/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
unable to access index for repository https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/src/contrib:
cannot open URL 'https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/src/contrib/PACKAGES'
Warning in install.packages :
package ‘Rstem’ is not available (for R version 3.5.1)
Warning in install.packages :
unable to access index for repository https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/bin/macosx/el-capitan/contrib/3.5:
cannot open URL 'https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
I already tried the suggested options in this link issues in installing Rstem package and also downloading the package locally from the official website Rstem Package, but the result is also unsatisfactory.
I'm studying how to do an sentiment analysis with Twitter data. I would like to know if there is any alternative to this package or if there is any trick to install it.
RStem package has been removed from the CRAN repository. You can download using the following command:-
install.packages('Rstem', repos = "http://www.omegahat.net/R")
Make sure you have RTools installed on your machine. You can download it from this link -
Building R for Windows
RStem is now provided by OmegaHat.
Try the command below:
install.packages("Rstem", repos = "http://www.omegahat.net/R", type = "source")

Not able to install TwitteR2Mongo Package in R

I am trying to install an R package for autonomous processing of Twitter data with the help of TwitteR2Mongo, but I'm getting the following error:
Warning in install.packages :
package ‘TwitteR2Mongo’ is not available (for R version 3.4.3)
package may not have been published to CRAN. but it builds from github for me on 3.4.3.
try
install.packages("devtools")
library(devtools)
install_github("ProjectTw/TwitteR2Mongo")

genderdata package unavailable for R 3.2.3

When I try installing the package "genderdata" to R,
install.packages("genderdata")
I get the following error:
Warning in install.packages :
package ‘genderdata’ is not available (for R version 3.2.3)`
Is there any way around this?
I tried this in my version of R 3.1.1 and got the same error message as you. When I looked closer it also said:
package ‘genderdata’ is available as a source package but not as a binary
I searched around some more and came up with this which worked for me.
options(repos = c("http://packages.ropensci.org/", getOption("repos")))
install.packages("genderdata", repos = "http://packages.ropensci.org", type="source")
I got several warnings but it did install and can be loaded with
library(genderdata)
Try installing from a source that doesn't limit you based on your R version with devtools and github.
install.packages('devtools')
library(devtools)
install_github("ropensci/genderdata")
library(genderdata)

r error on installing colorspace for ggplot2

I am an r newbie and would appreciate some help installing ggplot2. I am using RStudio Version 0.98.1102. Please see error below.
install.packages("ggplot2")
runs fine
library("ggplot2")
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck =
vI[[i]]) : there is no package called ‘colorspace’ Error: package or
namespace load failed for ‘ggplot2’
install.packages("colorspace")
Installing package into ‘C:/Users/Jessica/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified) There is a binary version available (and
will be installed) but the source version is later: binary source
colorspace 1.2-4 1.2-5 trying URL
'...//cran.rstudio.com/bin/windows/contrib/3.1/colorspace_1.2-4.zip'
Warning in install.packages : cannot open: HTTP status was '404 Not
Found' Error in download.file(url, destfile, method, mode = "wb", ...)
: cannot open URL
'...://cran.rstudio.com/bin/windows/contrib/3.1/colorspace_1.2-4.zip'
Warning in install.packages : download of package ‘colorspace’ failed
Looks like something is a bit messed up with the package meta-information or something in your Rstudio installation. A simple work-around to try is to just download the latest colorspace zip file from here: http://cran.r-project.org/web/packages/colorspace/index.html
Then install by running install.packages("c:/path/to/downloaded/zip/file/colorspace_1.2-5.zip")
When you type in install.packages("ggplot2") into the console, RStudio is pre-programmed to also install the dependencies (i.e. the other packages ggplot needs to run properly). In this case, the issue appears to be with the colorspace package not being able to installed. This is likely because you're running Yosemite and when RStudio looks to install colorspace, it searches for it on the CRAN, it can't find it for some reason:
cannot open URL 'http://cran.rstudio.com/bin/macosx/mavericks/contrib/3.1/colorspace_1.2-4.tgz'
You should be able to overcome this by installing the colorspace package yourself via the CRAN: http://cran.r-project.org/web/packages/colorspace/index.html.
Similar to the original question, I recently encountered this issue with colormap 2.0.0, ggplot2 3.3.2, R 4.0.3, and RStudio 1.3.1093 on Windows. install.packages("ggplot2") reports success even though it does not install colormap and library(ggplot2) therefore fails. In my case, install.packages("colormap") failed to locate the 2.0.0 binaries, retrieving the 1.4.1 sources instead. Downloading the 2.0.0 binary from https://CRAN.R-project.org/package=colorspace, as suggested in other answers, failed with
> install.packages("C:/Users/<username>/Downloads/colorspace_2.0-0.zip") # note use of forward slashes to avoid the backlash escaping problems #Paul M mentions in his comment on #L P's answer -- \\ instead of just \ also works
Warning in install.packages :
package ‘C:/Users/<username>/Downloads/colorspace_2.0-0.zip’ is not available for this version of R
What resolved this for me was including type = "win.binary" in install.packages()'s arguments when installing from the download.
install.packages("C:/Users/<username>/Downloads/colorspace_2.0-0.zip", type = "win.binary")
Having done this, install.packages("colorspace") also succeeds (both in session and after remove.packages("colorspace") and restarting R).
Try to install the color space separately and reload the package inside R studio again .
install.packages('ggplot2')
install.packages('colorspace')
library(ggplot2)
Hope this helps!
Sometimes when the Curl version is not updated, problem with installing the packages happens. For resolving the problem in Linux, you could use the following command to update your Curl to tha last version:
sudo apt-get install libcurl4-openssl-dev libxml2-dev
To me, it started giving this error when I updated all my packages using the available option "Packages" in R studio, it was working well before. After trying a few mentioned solutions in google and failed, I updated my R version and installed the packages, it worked.

Resources