superspread_fill: Convert single-code column(s) into "multiple choice" formats,...

View source: R/superspread_fill.R

superspread_fillR Documentation

Convert single-code column(s) into "multiple choice" formats, filling data from a target column

Description

Convert single-code column(s) into "multiple choice" formats, filling data from a target column

Usage

superspread_fill(df, tcol, select_helpers = everything(), target_col)

Arguments

df

Data frame to apply function to.

tcol

Number of columns to create

select_helpers

Use dplyr select helpers to apply function only to required columns.

target_col

Target column to take values from, in order to fill the new columns Leave blank to include everything

Examples

library(dplyr)
library(magrittr)
data.frame(a=c(1,2,4,5,6,7,8),b=c(244,333,434,453,123,123,435)) %>%
 superspread_fill(8,"a","b")


martinctc/surveytools documentation built on Nov. 21, 2024, 10:48 p.m.