select_by_topic.RdThis is a helper function for quickly and easily selecting or excluding topics in a NZ census data set.
select_by_topic(.data, topics, exclude = FALSE)
| .data | The data frame from which the topics should be selected/excluded from. |
|---|---|
| topics | A vector of census topics to be selected or excluded e.g. (c("number_of_rooms_for_occupied_private_dwellings", "number_of_bedrooms_for_occupied_private_dwellings")). |
| exclude | Whether the topics should be selected or excluded. |
A dataframe
Just a wrapper around a str_detect("pattern_1|pattern_2") selection.