For some work I plan on doing for the LACE tech focus blog I wanted to get some information off a webpage and in to an R dataframe. It turns out this is a three line solution (1 line if you throw your URL straight to the function paramaters and have the XML package already installed).

library(XML)
theurl <- "<URL STRING>"
data_frame_of_table <- readHTMLTable(theurl,which=<table number>,as.data.frame = TRUE

I’m pretty sure this is something I will need later in life.. thought I better blog it somewhere..

Categories: Data Analytics

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

css.php