2008/8/12 Aiste Aistike <[EMAIL PROTECTED]>:
> Hello,
>
> I have a problem with using read.csv(). I want to read a table from the ONS
> neighborhood statistics website which has an address:
>
> http://www.neighbourhood.statistics.gov.uk/dissemination/LeadTableView.do?a=3&b=5940246&c=Stoke&d=14&e=7&f=73&g=401878&i=1001x1003x1004x1005&l=145&o=1&m=0&r=1&s=1211997884568&enc=1&downloadTable=Download+this+table
>
> I was trying the following:
>
> #the parameter FamilyId I will need to change to get other datasets
> url1 <-  paste("
> http://www.neighbourhood.statistics.gov.uk/dissemination/LeadTableView.do?a=3&b=5940246&c=Stoke&d=14&e=7&f=73&g=401878&i=1001x1003x1004x1005&l=",FamilyId,"&o=1&m=0&r=1&s=1211997884568&enc=1&downloadTable=Download+this+table";,
> sep="")
> x <- read.csv(url1, header = FALSE, stringsAsFactors = FALSE)

 It looks like that URL doesn't actually return the CSV. The page you
get back has a 'refresh' meta-tag in it which sends your web browser
(firefox/IE) to another location. R doesn't care about this - because
it makes no attempt to make sense of the returned page - it just
returns what it got with the web request.

 There's also bits of JavaScript and other cruft in there. I can't
find a direct URL that gets the CSV straightaway which is what you
need. There's session id's and so on in the URL which might be
confusing things. I'll keep nosing around because this is a wonderful
example of how *not* to do web design.

What a mess!

Barry

______________________________________________
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.

Reply via email to