ed2_expand_wide: Expand multiple-response fields into wide data form

View source: R/helper_functions.R

ed2_expand_wideR Documentation

Expand multiple-response fields into wide data form

Description

Expand multiple-response fields into wide data form

Usage

ed2_expand_wide(df, col, clean_names = TRUE)

Arguments

df

The data frame containing the field to expand

col

The column name to split into wide form

clean_names

Whether new wide field names should be cleaned. Defaults to TRUE.

Value

A wide form dataframe with col field separated into different columns and filled with TRUE or FALSE values.

Examples

## Not run: 
humans <- ed2_human()
humans_reduced <- dplyr::select(humans, event_name, participant_id, travel_reason)
humans_reduced_wide <- ed2_expand_wide(humans_reduced, travel_reason)

## End(Not run)

ecohealthalliance/eidith documentation built on Aug. 30, 2022, 7:45 a.m.