recode_column_values: Recode Column Values This function will recode a column of...

recode_column_valuesR Documentation

Recode Column Values This function will recode a column of values in a tibble based o the list passed. If no list is passed none of the values will be replaces unless optional arguments are passed via ... to dplyr::recode such as .default or .missing

Description

Recode Column Values This function will recode a column of values in a tibble based o the list passed. If no list is passed none of the values will be replaces unless optional arguments are passed via ... to dplyr::recode such as .default or .missing

Usage

recode_column_values(tbl, column, lst = NULL, ...)

Arguments

tbl

A tibble

data <- dplyr::tribble( ~col1, ~col2, "a", "c", "a", "d", "b", NA )

column

A string that is the name of a column in the tbl that will be recoded

lst

A named list where each name is a possible value in the column, and the values are their replacements

lst <- list("a" = "x", "b" = "y", "c" = "z")

...

Other arguments to dplyr::recode


Sage-Bionetworks/projectliveModules documentation built on June 26, 2022, 1:11 a.m.