dfMergeTwoVariablesRelevel: Merge two variables into one, optionally map values to new...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Merge two variables into one, optionally map values to new levels

Usage

1
2

Arguments

df

A data.frame in which there are two variables (columns) to be merged into one.

colnames

A vector of length two with names of the two columns that hold the variables to be merged. See colnames for how to obtain the names of columns of a data frame.

levelslist

A list with one slice each for a new value to be used for a vector of old values (optional).

...

for deprecated varnames parameter (will be removed)

Value

A vector of strings

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
statusvalues <- list("ongoing" = c("Recruiting", "Active", "Ongoing",
                                   "Active, not recruiting", "Enrolling by invitation"),
                     "completed" = c("Completed", "Prematurely Ended", "Terminated"),
                     "other" = c("Withdrawn", "Suspended",
                                 "No longer available", "Not yet recruiting"))

dfMergeTwoVariablesRelevel(result, c("Recruitment", "x5_trial_status"), statusvalues)

## End(Not run)

rfhb/ctrdata documentation built on Jan. 15, 2019, 2:24 a.m.