drop_state_code: Remove the state portion of county fips

Description Usage Arguments See Also Examples

View source: R/data-dive.R

Description

Tableau seems to require just the county portion of the code for a given state.

Usage

1

Arguments

x

vector that holds the 5-digit fips code (e.g., 19001 for Iowa Adair county)

See Also

Other data dive functions: filter_demo(), get_county_map_dive(), load_cust_samp(), plot_county_dive(), plot_dist(), plot_trend(), run_visual_dive(), set_nonres_county_na(), set_other_county_na(), summarize_trend()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
db_license <- f <- "E:/SA/Data-production/Data-Dashboards/IA/license.sqlite3"
fips <- load_cust(db_license) %>% pull(county_fips)
fips_new <- drop_state_code(fips)
df <- data.frame(fips, fips_new, stringsAsFactors = FALSE)
head(df)
filter(df, nchar(fips) == 4) %>% tail()

# stop with error
drop_state_code(fips_new)

## End(Not run)

southwick-associates/sadash documentation built on Jan. 6, 2022, 5:17 p.m.