Gago-Silva
Gago-Silva

Reputation: 1971

Install R packages in archive

How can I install packages that are in archive, in Windows ?

http://cran.r-project.org/src/contrib/Archive/

When I try to install the tar.gz downloaded from the archive I get the following error:

Error in gzfile(file, "r") : cannot open the connection
In addition: Warning messages:
1: In unzip(zipname, exdir = dest) : error 1 in extracting from zip file
2: In gzfile(file, "r") :
  cannot open compressed file 'grasp_2.5-7.tar.gz/DESCRIPTION', probable reason 'No such file or directory'

Upvotes: 6

Views: 4582

Answers (3)

Constanza Garcia
Constanza Garcia

Reputation: 366

I had the same problem installing graph package from archive. The package is required for another package (bnclasify).

chooseBioCmirror() #select a different mirror than CRAN. This mirror may be #because is the one that has bnclasify in it (check this statement)

setRepositories() #In here you can select as many as you want to search for the       #package you need

ap <- available.packages() #list of all available packages

"graph" %in% rownames(ap) #search the package you need by name (return TRUE or #FALSE). 

install.packages("graph", dependencies=TRUE) #if the last statement TRUE then #install the package like normally

Upvotes: 0

Ramnath
Ramnath

Reputation: 55735

You can try the function install_version in devtools. Let us suppose you want to install version 0.8 of ggplot2, you can call it as install_version('ggplot2', '0.8'). If you are on Windows, you can follow the instructions here to build packages from source.

Upvotes: 6

Paul Hiemstra
Paul Hiemstra

Reputation: 60984

You can download the sources (tar.gz files) and install them using:

R CMD INSTALL packagename.tar.gz

Upvotes: 5

Related Questions