ed2_expand_long: Expand multiple-response fields into long data form

View source: R/helper_functions.R

ed2_expand_longR Documentation

Expand multiple-response fields into long data form

Description

Expand multiple-response fields into long data form

Usage

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

## 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. 30, 2022, 7:45 a.m.