readUSstateAbbreviations(url.=
"http://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') )
subNonStandardCharacters
and strsplit(x, "\[")
readUSstateAbbreviatons
returns a data.frame
from the
table in
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.getURL
readHTMLTable
make.names
USstateAbbreviations
if(!fda::CRAN()){
abbreviations <- readUSstateAbbreviations()
}
Run the code above in your browser using DataLab