wiki_table_header: A Function to Parse an HTML Table Header

Description Usage Arguments Value Examples

View source: R/parse_table.R

Description

Takes an HTML table, parses it's format, and returns a character vector as long as the input table is wide.

Usage

1
2
3
wiki_table_header(table, header_length = "auto", skip = "auto",
  col_names = NULL, rm_text = NULL, rm_brackets = TRUE,
  rm_parens = FALSE)

Arguments

table

An HTML table object.

header_length

Set to a number greater than one to deal with multi-row headers. Takes an integer and defaults to 1.

skip

The number of rows to skip before collecting data. This is useful for omitting full-width "title" cells. Takes a character vector of rows to skip or the string "auto", and defaults to "auto". If argument is set to "auto", parser will automatically remove cells that take up a full row.

exclude_brackets

Whether to exclude brackets and their contents in output. Takes a boolean and defaults to TRUE.

exclude_parens

Whether to exclude parenthesis and their contents in output. Takes a boolean and defaults to FALSE.

Value

Returns a character vector of parsed headers.

Examples

1
2
wiki_table("https://wikipedia.org/wiki/List_of_metro_systems")
wiki_table("List_of_metro_systems")

niedermansam/wikiScraper documentation built on Nov. 4, 2019, 10:06 p.m.