select_by_topic: Filter the census topics in a census dataframe

Description Usage Arguments Details Value Examples

Description

This is a helper function for quickly and easily selecting or excluding topics on a wide nzcensr data set.

Usage

1
select_by_topic(.data, topics, exclude = FALSE)

Arguments

.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.

Details

Really just a wrapper around a str_detect("pattern_1|pattern_2") selection.

Value

A dataframe

Examples

1
select_by_topic(dwelling_area_units, c("fuel_types", "private_dwelling"))

phildonovan/nzcensr documentation built on May 12, 2019, 7:20 p.m.