Re: [R] Extracting a data.frame from HTML code

2008-04-13 Thread Paul Smith
On Sun, Apr 13, 2008 at 12:37 AM, Martin Morgan <[EMAIL PROTECTED]> wrote: > Hi Ethan -- > > Use the XML library > > > library(XML) > > url <- > 'http://www.nascar.com/races/cup/2007/1/data/standings_official.html' > > xml <- htmlTreeParse(url, useInternal=TRUE) > > The previous line retrieve

Re: [R] Extracting a data.frame from HTML code

2008-04-12 Thread Martin Morgan
Hi Ethan -- Use the XML library > library(XML) > url <- 'http://www.nascar.com/races/cup/2007/1/data/standings_official.html' > xml <- htmlTreeParse(url, useInternal=TRUE) The previous line retrieves the html and stores it in an internal represnetation. There are warnings, but I think these are

[R] Extracting a data.frame from HTML code

2008-04-12 Thread Ethan Pew
Dear all, I'd like to use R to read in data from the web. I need some help finding an efficient way to strip the HTML tags and reformat the data as a data.frame to analyze in R. I'm currently using readLines() to read in the HTML code and then grep() to isolate the block of HTML code I want from