ed2_expand_long: Expand multiple-response fields into long data form

Description Usage Arguments Value Examples

View source: R/helper_functions.R

Description

Expand multiple-response fields into long data form

Usage

1
ed2_expand_long(df, col, other_details = TRUE)

Arguments

df

The data frame containing the field to expand

col

The column name to split into long form

other_details

Whether other category should be consolidated and a new column with other details added. Defaults to TRUE.

Value

A long form dataframe with col field separated into repeated entries.

Examples

1
2
3
4
5
6
## Not run: 
humans <- ed2_human()
humans_reduced <- dplyr::select(humans, event_name, participant_id, travel_reason)
humans_reduced_long <- ed2_expand_long(humans_reduced, travel_reason)

## End(Not run)

ecohealthalliance/eidith documentation built on Aug. 20, 2019, 9:28 p.m.