Skip to content

Instantly share code, notes, and snippets.

@rgrannell1
Last active December 16, 2015 06:59
Show Gist options
  • Save rgrannell1/5395195 to your computer and use it in GitHub Desktop.
Save rgrannell1/5395195 to your computer and use it in GitHub Desktop.
require(XML)
require(stringr)
raw <- paste0(readHTMLTable('http://www.w3schools.com/tags/')$`NULL`$Tag)
processed <- unname(c(Filter(Negate(is.null),
Map (
function (name) {
if (str_detect(name, '<h1> to')) NULL else str_replace(name, 'New.*$', '')
},
raw)),
paste0('<h', 1:6, '>')
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment