Skip to contents

which fips, state names, or state abbreviations are island areas

Usage

is.island(ST = NULL, statename = NULL, fips = NULL)

Arguments

ST

optional vector of 2 letter state abbreviations

statename

optional vector of statenames like "texas" or "Delaware"

fips

optional vector of FIPS codes (first 2 characters get used)

Value

logical vector of same length as the input

Examples

  is.island(c("PR", "DE", "AS", NA))
#> note some of ST are among AS, GU, MP, UM, VI
#> Warning: NA returned for 1 ST that failed to match
#> [1] FALSE FALSE  TRUE FALSE
  is.island(statename = c("Guam", "New York", "american samoa", NA))
#> Warning: NA returned for 1 values that failed to match
#> [1]  TRUE FALSE  TRUE FALSE
  is.island(fips = c(21001, 60, "60", "600010000000"))
#> [1] FALSE  TRUE  TRUE  TRUE
  tail(cbind(stateinfo2[ , c("statename", "is.island.areas")], is.island(stateinfo2$ST)),10)
#> note some of ST are among AS, GU, MP, UM, VI
#> Warning: NA returned for 1 ST that failed to match
#>                      statename is.island.areas is.island(stateinfo2$ST)
#> 56               West Virginia           FALSE                    FALSE
#> 57                   Wisconsin           FALSE                    FALSE
#> 58                     Wyoming           FALSE                    FALSE
#> 3               American Samoa            TRUE                     TRUE
#> 13                        Guam            TRUE                     TRUE
#> 38    Northern Mariana Islands            TRUE                     TRUE
#> 43                 Puerto Rico           FALSE                    FALSE
#> 49 U.S. Minor Outlying Islands            TRUE                     TRUE
#> 50         U.S. Virgin Islands            TRUE                     TRUE
#> 51               United States           FALSE                    FALSE