Learn R Programming

OIdata (version 1.0)

getTables: Get the tables from a web page

Description

Retrieve each of the tables in a web page. Tables that have tables nested within them will be ignored.

Usage

getTables(URL)

Arguments

URL
A character string of a URL, usually beginning with http://

Value

A list, where each item is a table in the webpage.

See Also

processTable, getURL

Examples

Run this code
## Not run: 
# URL     <- "http://en.wikipedia.org/wiki/Poverty_in_the_United_States"
# Tables  <- getTables(URL)
# thisOne <- which(sapply(Tables, "[", 1, 1) == "Persons in Family Unit")
# if(length(thisOne) > 0){
#   Tables[[thisOne[1]]]
# }
# ## End(Not run)

Run the code above in your browser using DataLab