[R] downloading web content

David Winsemius dwinsemius at comcast.net
Tue Jul 23 18:07:47 CEST 2013


On Jul 23, 2013, at 2:59 AM, Daisy Englert Duursma wrote:

> Hello,
> I am trying to use R to download a bunch of .csv  files such as:

It's are not a csv file; instead it's a zip file. Why not use the `download.file` function. This downloads it to my working directory:

> download.file("http://biocache.ala.org.au/ws/occurrences/download?q=Banksia+ericifolia", "data.zip")
trying URL 'http://biocache.ala.org.au/ws/occurrences/download?q=Banksia+ericifolia'
Content type 'application/zip' length unknown
opened URL
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
....
downloaded 204 Kb

-- 
David.


> 
> http://biocache.ala.org.au/ws/occurrences/download?q=Banksia+ericifolia
> 
> I have tried the following and neither work:
> 
> a<- getURL("
> http://biocache.ala.org.au/ws/occurrences/download?q=Banksia+ericifolia")
> 
> Error in curlPerform(curl = curl, .opts = opts, .encoding = .encoding) :
>  embedded nul in string:
> and
> 
> a<-httpPOST("
> http://biocache.ala.org.au/ws/occurrences/download?q=Banksia+ericifolia")
> 
> Error: Internal Server Error
> 
> 
> Any help would be appreciated.
> 
> Daisy
> -- 
> Daisy Englert Duursma
> Department of Biological Sciences
> Room E8C156
> Macquarie University, North Ryde, NSW 2109
> Australia
> 
> 	[[alternative HTML version deleted]]

And do learn to post in plain-text.

-- 

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list