State code look up

Share:

Description

Function to simplify finding state and state code definitions. Used in readNWISdata and readWQPdata.

Usage

1
stateCdLookup(input, outputType = "postal")

Arguments

input

could be character (full name, abbreviation, id), or numeric (id)

outputType

character can be "postal","fullName","tableIndex", or "id".

Examples

1
2
3
4
5
6
7
fullName <- stateCdLookup("wi", "fullName")
abbriev <- stateCdLookup("Wisconsin", "postal")
id <- stateCdLookup("WI", "id")
name <- stateCdLookup(55, "fullName")
index <- stateCdLookup("WI", "tableIndex")
stateCd[index,]
stateCdLookup(c("West Virginia", "Wisconsin", 55, "MN"))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.