Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

readUSstateAbbreviations

Read a list of abbreviations of states and territories of the United States


Description

Read the list of abbreviations of states and territories of the United States from the relevant Wikipedia article

Usage

readUSstateAbbreviations(url.=
"https://en.wikipedia.org/wiki/List_of_U.S._state_abbreviations",
      clean=TRUE, Names=c('Name', 'Status', 'ISO', 'ANSI.letters',
          'ANSI.digits', 'USPS', 'USCG', 'Old.GPO', 'AP', 'Other') )

Arguments

url.

Universal resource locator to be read and processed to obtain the desired list

clean

logical: If TRUE, clean the data using subNonStandardCharacters and strsplit(x, "\[")

Names

names for the columns of the data matrix read; ignored with a warning if the lengths do not match

Details

Wrapper for readHTMLTable.

NOTE: readHTMLTable(url) returns a list of length 7, only one of which is the table we want. Moreover, that table contains some duplicates, which are removed by readUSstateAbbreviations. For example, 'NB' is an "Obsolete postal code" for Nebraska. If you need this, please consult the Wikipedia article.

Value

readUSstateAbbreviatons returns a data.frame from the table in the Wikipedia article on "List of U.S. state abbreviations".

Author(s)

Spencer Graves

See Also

Examples

if(!fda::CRAN()){
abbreviations <- readUSstateAbbreviations()
}

Ecfun

Functions for 'Ecdat'

v0.2-4
GPL (>= 2)
Authors
Spencer Graves <spencer.graves@effectivedefense.org>
Initial release
2020-10-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.