ff_acs_filter | R Documentation |
With this function, users can imput a regular expression and column with descriptive text, and the dataset will be filtered based on the regualr expression.
ff_acs_filter( df, filter_column, filter_re, subtype_re = NULL, recode = F, recode_list = NULL )
df |
Dataframe of ACS data |
filter_column |
Column name that contains descriptive text to filter for, entered as object |
filter_re |
Regular expression used to filter on |
subtype_re |
Regular expression to further extract words from 'filter_re' and place in a new column called 'subtype' |
recode |
Boolean indicating whether to recode the newly created 'subtype' column |
recode_list |
A named list mapping the recode values |
Users can also extract a section of the regular expression, and place this phrase into a different column titled 'subtype'. Finally users can recode the newly created 'subtype' column by enting a named list of values.
A dataframe only containing the filtered rows; and an additiona lcolumn called 'subtype' if 'recode = T'.
age_bins <- list(`16 to 26 year old` = "16 to 25", `75 and over` = "over 75") ff_acs_filter(employment, description, "AGE -", "[0-9].*",
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.