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 <sagarnikam...@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@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. ______________________________________________ R-help@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.