refactorer: easier way to refactor using lists

Description Usage Arguments Details Value Examples

View source: R/refactorer.R

Description

Refactor a factor using input lists

Usage

1
2
3
4
5
6
7
refactorer(
  data_frame,
  column,
  level_vector,
  label_vector,
  other_label = "Unknown"
)

Arguments

data_frame

The data frame containing the column

column

The column to refactor

level_vector

The levels in the orignal column

label_vector

The labels to apply

other_label

The label to use for 'other' values (e.g. unknowns)

Details

This function allows for quick bulk replacement of the labels of a factor rather than the more complex forcats way...

Value

an updated column

Examples

1
2
3
4
## Not run: 
To add!

## End(Not run)

MarkGoble/mishMashr documentation built on Oct. 12, 2020, 8:24 p.m.