survey_collapse_categorical_long: Collapse categorical data into tidy long format

survey_collapse_categorical_longR Documentation

Collapse categorical data into tidy long format

Description

'survey_collapse_categorical)long()' uses the srvyr [srvyr::survey_mean] & survey package [survey::svyciprop] methods to collapse/or aggregate cateogrical data. This function can be used on its own, but was build mainly to for its use in [butteR::survey_collapse] which is meant to help batch analyze data

Usage

survey_collapse_categorical_long(df, x, disag = NULL, na_val = NA_character_)

Arguments

x

columns to collapse

disag

the columns to collapse/ subset by(analagous to [[dplyr::group_by]] to [[dplyr::summarise]]) flow #' @param 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

dfsvy

a survey or preferably srvyr object

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.


mhkhan27/illuminate documentation built on March 25, 2023, 5:41 p.m.