I have been using the "stats" package in R 3.0.1 without any problems . But today i deleted the "stats" folder from the R library location and now I can't install it any more. I tried doing the same thing with other packages but I could install everything except "stats"
install.packages("stats", dep = TRUE, repos="http://cran.cs.wwu.edu")
## Installing package into ‘%Default R Lib Installation Path%’
## (as ‘lib’ is unspecified)
## Warning in install.packages : package ‘stats’ is not available (for R version 3.0.1)
I also tried downloading it from other sources like "http://cran.ma.imperial.ac.uk/" but nothing works . Any ideas?
Once the package is installed, you keep that in your R library associated with your current major version of R. You will need to update & reinstall packages each time you update a major version of R.
The most common way is to use the CRAN repository, then you just need the name of the package and use the command install. packages("package") .
If you have older versions of either R , or Python , it is recommended to update them to the newest versions in order to avoid any errors. To do this, we firstly need to completely remove the currently installed versions.
What worked for me was to copy the entire package folder from another to my R.home()
directory.
(Since SO is nagging me not to continue the comment thread, I will post an answer.)
I believe that this problem will apply to any base package (but not to those installed from repositories, and probably not to Recommended packages): I am deeply skeptical that stats
is the only package. It should occur for any of the packages in this list:
rownames(subset(as.data.frame(installed.packages()),Priority=="base"))
I'm sure it's theoretically possible to re-install a base package from scratch, but it will be much easier to re-install R. At a guess, it would take me about 15 minutes to re-install R, and I would feel lucky if I figured out how to re-install a base package on its own in less than an hour.
I'm pretty sure that re-installing R will not affect previously-installed packages: see e.g. http://cran.r-project.org/bin/windows/base/rw-FAQ.html#How-do-I-UNinstall-R_003f; that link is about uninstalling rather than re-installing, but this seems relevant:
Uninstalling R only removes files from the initial installation, not (for example) packages you have installed or updated.
Other choices would be
PS: obviously if you are doing this on a client's machine it would be a good idea to test my advice first ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With