Skip to content
Prev 332702 / 398506 Next

Download CSV Files from EUROSTAT Website

This looks as though you need to be a little XML old-school.
readHTMLTable is a summary function drawing on:

?htmlTreeParse() turns the table into xml
?xpathApply()
and more.

#xpathApply(doc, , "//td", function(x)xmlValue(x)) breaks each line at
the end of a table cell and extracts the value

# The "//th" picks out the table headings without distinction as to
whether they are rows or columns

Followed by various gsub()  and turning it into a matrix (as this
comes out with a list of values without columns. I couldn't identify
the headings, but the table body is definitely doable.

readHTMLTable seems to assume that the column headings are a single
row, which isn't always the case.

Paul Bivand
On 5 November 2013 18:44, Barry Rowlingson <b.rowlingson at lancaster.ac.uk> wrote: