survey_collapse: Batch Collapse Survey Data into tidy long format

Description Usage Arguments Value

View source: R/survey_collapse.R

Description

'survey_collapse' uses the srvyr [srvyr::survey_mean] & survey package [survey::svymean] methods to collapse/or aggregate survey data. This function uses 'survey_collapse_categorical_long' and 'survey_collapse_binary_long' to perform the batch analysis

Usage

1
survey_collapse(df, vars_to_analyze, disag = NULL, na_val, sm_sep = "/")

Arguments

df

a survey or preferably srvyr object

vars_to_analyze

columns to collapse

disag

the columns to collapse/ subset by(analagous to [[dplyr::group_by]] to [[dplyr::summarise]]) flow

na_val

if you want NA replaced by value. By default NA values will be removed prior to aggregation. It is recommended that you do not adjust this value and deal with na values as a separate step

sm_sep

select multiple parent child separator. This is specific for XLSForm data (default = /). If using read_csv to read in data the separator will most likely be '/' where as if using read.csv it will likely be '.'

Value

a long format data frame containing the collapsed data.


zackarno/butteR documentation built on May 8, 2021, 4:50 p.m.