I'm having trouble following the selected answer to this question. The table I'm trying to scrape is this list of U.S. state populations.
library(XML)
theurl <- "http://en.wikipedia.org/wiki/List_of_U.S._states_and_territories_by_population"
tables <- readHTMLTable(theurl)
n.rows <- unlist(lapply(tables, function(t) dim(t)[1]))
This is the error I'm getting..
Error: failed to load external entity "http://en.wikipedia.org/wiki/List_of_U.S._states_and_territories_by_population"
What gives?
(Note - although I'm looking to resolve this error, if you can point me to an easier way of getting population data I'd appreciate it.)