removeColumns: Helper function to remove columns from data based on reg-exp...

Description Usage Arguments Value Examples

View source: R/formhub.R

Description

Helper function to remove columns from data based on reg-exp matching. Also takes list of strings.

Usage

1
removeColumns(df, columnNameRegExpMatcher)

Arguments

df

data

columnNameRegExpMatcher

pattern(s) to match to columns; matched columns are dropped.

Value

a smaller data frame.

Examples

1
2
3
4
good_eats_df <- formhubDownload("good_eats", "mberg")
names(good_eats_form_df) # note it includes submit_date and submit_data both
names(removeColumns(good_eats_form_df, "submit*")) # both of which are gone now
names(removeColumns(good_eats_form_df, c("submit*", "_gps*")) # you can pass a list of regular expressions

prabhasp/formhub.R documentation built on May 25, 2019, 11:25 a.m.