# Not case sensitive when using state names
ca_zctas = get_zctas_by_state("CaLiFoRNia")
length(ca_zctas)
head(ca_zctas)
# "06" is the FIPS code for California
ca_zctas = get_zctas_by_state("06")
length(ca_zctas)
head(ca_zctas)
# 6 is OK too - sometimes people use numbers for FIPS codes
ca_zctas = get_zctas_by_state(6)
length(ca_zctas)
head(ca_zctas)
# USPS state abbreviations are also OK
ca_zctas = get_zctas_by_state("CA")
length(ca_zctas)
head(ca_zctas)
# Multiple states at the same time are also OK
ca_ny_zctas = get_zctas_by_state(c("CA", "NY"))
length(ca_ny_zctas)
head(ca_ny_zctas)
Run the code above in your browser using DataLab