my_gather: Tranform a dataframe from wide to long

Description Usage Arguments Value Examples

Description

Tranform a dataframe from wide to long

Usage

1
my_gather(data, keyname = "key", valuename = "value", chosen_cols)

Arguments

data

A data frame

keyname

Name of new key column, a string

valuename

Name of new value column , a string

chosen_cols

Name of columns to be gathered, a list

Value

A data frame

Examples

1
2
df <- data.frame(Groups = c("A","B"), Married = c(12,25), Other = c(100,55))
my_gather(df,"status","count", list("Married","Other"))

UBC-MDS/miniTidyR documentation built on May 7, 2019, 7:14 p.m.