Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems with Downloading pdf file using R

Tags:

r

pdf

I would like to download a pdf file from the internet and save it in the local HD. After download, the pdf output file has lots of empty pages. What can I do to fix it?

Example:

require(XML)
url <- ('http://cran.r-project.org/doc/manuals/R-intro.pdf')
download.file(url, 'introductionToR.pdf')

Thanks in advance.

like image 761
Diogo Avatar asked Feb 14 '12 16:02

Diogo


1 Answers

Try with wb-mode like this:

download.file(url, 'introductionToR.pdf', mode="wb").

For me it works that way.

like image 96
Sophia Avatar answered Oct 05 '22 11:10

Sophia