[R] how to download source code, pdf manual for any package from internet?
sagarnikam123
sagarnikam123 at gmail.com
Sat May 19 16:22:44 CEST 2012
i use download.file() ,it works good for package source code
t<-available.packages(type="source") #all packages(list) from repository in
source code ".tar.gz" format
length(t[,2]) #total packages--> 3796
#package source file download
for( i in seq_along(t[,1]) ) {
download.file(
paste(t[i,"Repository"],"/",t[i,"Package"],"_",t[i,"Version"],".tar.gz",sep=""),destfile=paste("C:/Users/exam.2-235/Documents/R_laveria/",t[i,"Package"],"_",t[i,"Version"],".tar.gz",sep="")
)
}
#package pdf downloading
for(j in seq_along(t[,1]) ){
download.file(
paste("http://cran.r-project.org/web/packages/",t[j,"Package"],"/",t[j,"Package"],".pdf",sep=""),destfile=paste("C:/Users/exam.2-235/Documents/R_rab/",t[j,"Package"],".pdf",sep="")
)
}
when i am trying for pdf ,it downloads completely, but when open in pdf
reader,it tell that "pdf cannot be open because it's damaged & cannot be
repaired"
what will be problem ? i am working on windows-vista
--
View this message in context: http://r.789695.n4.nabble.com/how-to-download-source-code-pdf-manual-for-any-package-from-internet-tp4630354p4630600.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list