install old package R

社会主义新天地 提交于 2020-02-06 17:44:15

问题


i'm working in Rstudio version 0.98.507.0 and R 3.1.1. I'm working in a virtual machine, i can not install anything in the computer (professional computer and it's take so long to get authorization for new installation)

i'm looking to install package "plotly" but this package require "dplyr" to work; The current version of "dplyr" is only working with R version 3.1.2

as well i'm trying to install an older version of "dplyr but nothing works. i downloaded the files from cran. i put the file in the directory and here are the code i have tryied and the error message i got:

1)

install.packages("J:/ PATH TO THE FILE/dplyr_0.7.0.tar.gz",repos = NULL, type="source") 

the error is:

   Warning: invalid package 'J:/ PATH/dplyr_0.7.0.tar.gz'
 Error: ERROR: no packages specified
 Warning in install.packages :
 running command '"Q:/R.001/R-31~1.1/bin/i386/R" CMD INSTALL -l "C:\Users\I0368711\Documents\R\win-library\3.1" "J:/PATH/R/dplyr_0.7.0.tar.gz"' had status 1
 Warning in install.packages :
 installation of package ‘J:/PATH/dplyr_0.7.0.tar.gz’ had non-zero exit status 

2) Then i tried to set the working directory, and i run

install.packages("dplyr_0.7.0.tar.gz",repos = NULL, type="source")

the error message is

CMD.EXE was started with the above path as the current directory.
 UNC paths are not supported. Defaulting to Windows directory.
PATH TO THE FILE
 Warning: invalid package 'dplyr_0.7.0.tar.gz'
 Error: ERROR: no packages specified
 Warning in install.packages :
 running command '"Q:/R.001/R-31~1.1/bin/i386/R" CMD INSTALL -l "C:\Users\I0368711\Documents\R\win-library\3.1" "dplyr_0.7.0.tar.gz"' had status 1
 Warning in install.packages :
 installation of package ‘dplyr_0.7.0.tar.gz’ had non-zero exit status
 Warning in install.packages :
 running command '"Q:/R.001/R-31~1.1/bin/i386/R" CMD INSTALL -l "C:\Users\I0368711\Documents\R\win-library\3.1" "dplyr_0.7.0.tar.gz"' had status 1
 Warning in install.packages :
 installation of package ‘dplyr_0.7.0.tar.gz’ had non-zero exit status 

3)
i tried another solution:

install_version("dplyr", version = "0.7.0", repos = "http://cran.us.r-project.org")

the error message is:

Error in as.POSIXct.default(value) : 
  do not know how to convert 'value' to class “POSIXct”

4) the last solution i tried is:

 path<- "https:/cran.r-project.org/src/contrib/Archive/dplyr/dplyr_0.7.0.tar.gz"
install.packages(path, repos=NULL, type="source")

but it doesnt work too..

I really have no idea of what else i could do to try to install this packages..

sorry for my bad level in English, i made my best to create an understandable topic..

Thanks for the help

EDIT:

5)

path<- "https://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_0.7.0.tar.gz"
install.packages(path, repos=NULL, type="source")

i have the message

trying URL 'https://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_0.7.0.tar.gz'

but nothing happend and after 5 minutes I decide to close the programme

6)

install.packages("file://J:PATH/dplyr_0.7.0.tar.gz",repos = NULL, type="source")

i got the same error messager than 1.

because i got an old R version, i tryied to install dplyr version 0.1, created in 2014, but it doesnt work as well. i tryied to install the package manually in my personnal computer, to see if i'm doing something wrong, and solution 6 is working in my computer (solution 5 didnt)


回答1:


From ?install.packages:

(‘http://’ and ‘file://’ URLs are also accepted and the files will be downloaded and installed from local copies.)

So your last attempt was pretty close:

path<- "https://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_0.7.0.tar.gz"
#             ^^
install.packages(path, repos=NULL, type="source")
#                ^^^^

This will work if you have all dependencies already installed locally. Also your first attempts should have worked if you had used file://J:/....

Another possibility for getting older packages is to use an appropriate MRAN snapshot. For example, if I download the docker image rocker/r-ver:3.3.3 then https://mran.microsoft.com/snapshot/2017-04-21 is used as repository.




回答2:


okay! So i found a way

the code to run the installation from cran website is

path<- "http://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_0.7.0.tar.gz"
install.packages(path, repos=NULL, type="source")

There is no S at http

i still have huge problem about dependencie to install my package but i think i'll be able to solve them. Thanks for your time!



来源:https://stackoverflow.com/questions/50800215/install-old-package-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!