[R] how to download source code, pdf manual for any package from internet?

Henrik Bengtsson hb at biostat.ucsf.edu
Sat May 19 21:31:37 CEST 2012


You need to specify that you want a binary download - make sure to
read help("download.file"), particular that of argument 'mode'.
Alternatively, use downloadFile() in the R.utils package which
download as binary by default.

/Henrik



On Sat, May 19, 2012 at 7:22 AM, sagarnikam123 <sagarnikam123 at gmail.com> wrote:
> 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.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list