Re: [R] read.*: How to read from a URL?

2008-12-10 Thread Martin Morgan
Martin Morgan wrote: Prof Brian Ripley wrote: On Wed, 10 Dec 2008, hadley wickham wrote: Hi Michael, In general, I think you should be able to do: gimage <- read.jpeg(url(gimageloc)) Note that would not be really correct: it would need to be gimage <- read.jpeg(con <- url(gimageloc)) clos

Re: [R] read.*: How to read from a URL?

2008-12-10 Thread Duncan Murdoch
On 10/12/2008 5:41 PM, Prof Brian Ripley wrote: On Wed, 10 Dec 2008, hadley wickham wrote: Hi Michael, In general, I think you should be able to do: gimage <- read.jpeg(url(gimageloc)) Note that would not be really correct: it would need to be gimage <- read.jpeg(con <- url(gimageloc)) clo

Re: [R] read.*: How to read from a URL?

2008-12-10 Thread Martin Morgan
Prof Brian Ripley wrote: On Wed, 10 Dec 2008, hadley wickham wrote: Hi Michael, In general, I think you should be able to do: gimage <- read.jpeg(url(gimageloc)) Note that would not be really correct: it would need to be gimage <- read.jpeg(con <- url(gimageloc)) close(con) since it other

Re: [R] read.*: How to read from a URL?

2008-12-10 Thread Prof Brian Ripley
On Wed, 10 Dec 2008, hadley wickham wrote: Hi Michael, In general, I think you should be able to do: gimage <- read.jpeg(url(gimageloc)) Note that would not be really correct: it would need to be gimage <- read.jpeg(con <- url(gimageloc)) close(con) since it otherwise leaks a connection (w

Re: [R] read.*: How to read from a URL?

2008-12-10 Thread Duncan Murdoch
If you use url("http://euclid.psych.yorku.ca/SCS/Gallery/Private/langrens.csv";) then most functions will work, because that creates a connection to read the URL. Most functions that can read files do it through connections. Duncan Murdoch On 12/10/2008 2:17 PM, Michael Friendly wrote: The q

Re: [R] read.*: How to read from a URL?

2008-12-10 Thread hadley wickham
Hi Michael, In general, I think you should be able to do: gimage <- read.jpeg(url(gimageloc)) or alternatively use the EBImage from bioconductor which will read from a url automatically (it also opens a much wider range of file types) library(EBImage) img <- readImage(gimageloc, TrueColor) Had

[R] read.*: How to read from a URL?

2008-12-10 Thread Michael Friendly
The question is how to use a URL in place of a file= argument for read.*.functions that do not support this internally. e.g., utils::read.table() and her family all support a file= argument that can take a URL equally well as a local file. So, if I have a file on the web, I can equally well d