The function will fetch and return the FIPS for the counties of interest.
As some counties will change due to various causes, it is easier to track the counties
by FIPS code for a long-term analysis. Description of FIPS codes is available via
[here](https://en.wikipedia.org/wiki/FIPS_county_code)
get_FIPS(data, counties = NULL, states = NULL, overlap_state_county = TRUE, combine_state_county = TRUE)
data | the dataset to work with, generally the full usfertilizer or its subsets. |
---|---|
counties | counties of interest, defalut: all avaible counties. |
states | states of interest, defalt: all avaialble states. |
overlap_state_county | Logic. If true, the function will overlaping the input of states and counties. If false, the function will return results either in the states or in the counties. |
combine_state_county | Logic. If true, the county will be changed into county, state, e.g. Wake, NC; If false, no changes. |
A tibble with tidy data.
link(get_data)
data = fertilizer get_FIPS(data, counties = "Wake", states = "NC")#> # A tibble: 1 x 2 #> FIPS County #> <chr> <chr> #> 1 37183 Wake, NCget_FIPS(data, states = "NC")#> # A tibble: 100 x 2 #> FIPS County #> <chr> <chr> #> 1 37001 Alamance, NC #> 2 37003 Alexander, NC #> 3 37005 Alleghany, NC #> 4 37007 Anson, NC #> 5 37009 Ashe, NC #> 6 37011 Avery, NC #> 7 37013 Beaufort, NC #> 8 37015 Bertie, NC #> 9 37017 Bladen, NC #> 10 37019 Brunswick, NC #> # ... with 90 more rows