Lucinho91
Lucinho91

Reputation: 195

How to install archived R packages on windows machine?

I am trying to install the archived R packages from these websites:

https://cran.r-project.org/src/contrib/Archive/sentiment/ https://cran.r-project.org/src/contrib/Archive/Rstem/

However, I cannot get it to work for around 2 hours now! I have been using a variety of different approaches including installing them manually, nothing worked :(

Do you know a trick for that?

Upvotes: 3

Views: 2521

Answers (1)

Philipp HB
Philipp HB

Reputation: 179

There are several ways you can try to install archived packages.

  1. Using the devtools package.

    require(devtools)
    install_version("sentiment", version = "0.2", repos = "http://cran.r-project.org")
    install_version("Rstem", version = "0.4.1", repos = "http://cran.r-project.org")
    
  2. Installing from source in R

    sentimenturl <- "https://cran.r-project.org/src/contrib/Archive/sentiment/sentiment_0.2.tar.gz"
    rstemurl <- "https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz"
    install.packages(sentimenturl, repos=NULL, type="source")
    install.packages(rstemurl, repos=NULL, type="source")
    
  3. Installing from source from the command line

    wget https://cran.r-project.org/src/contrib/Archive/sentiment/sentiment_0.2.tar.gz
    R CMD INSTALL sentiment_0.2.tar.gz
    wget https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz
    R CMD INSTALL Rstem_0.4-1.tar.gz
    

For a Windows machine you will most likely need to have Rtools installed. You can follow the installation steps here: https://github.com/stan-dev/rstan/wiki/Install-Rtools-for-Windows

Credit: https://support.rstudio.com/hc/en-us/articles/219949047-Installing-older-versions-of-packages

Hope that helps!

Upvotes: 4

Related Questions