ensure_factor {tableeasy} | R Documentation |
Ensure Factor Variable in Data Set
Description
Ensure that factor variables in data set are of the correct type.
Usage
ensure_factor(data, execute = FALSE, threshold_factor = 5)
Arguments
data |
A data frame. |
execute |
Bool, default |
threshold_factor |
An integer, default |
Value
A list containing data frame and description.
Examples
## Load Mayo Clinic Primary Biliary Cirrhosis Data
library(survival)
library(tableeasy)
data(pbc)
## Check variables
head(pbc)
##
ensure_factor(pbc)
ensure_factor(pbc,execute=TRUE)[['message']]
pbc_exe <- ensure_factor(pbc,execute=TRUE)[['data']]
[Package tableeasy version 1.1.2 Index]