You've successfully subscribed to MyPad Blog
Great! Next, complete checkout for full access to MyPad Blog
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.

Extremely quick way to read html tables and import into R

Extremely quick way to read html tables and import into R

For a recent consulting assignment, we needed to get earnings data for today from a reliable source.

The data from our current provider was not completely accurate and we planned to use Yahoo's calendar as a second check.

Getting this data using an automated method is possible but required significant time!

Here is a quick way to get the data quite efficiently:

  • Read the data to the clipboard using table to csv Chrome extension
  • Read the data into R using datapasta

Pretty quick and does the job! The post image shows the usage.

library(datapasta)
tribble_construct() -> tbl
eval(parse(textConnection(tbl))) -> df_earnings_calendar