3.2 lung data
The sample code will use data from the lung
dataset in the survival
package. To run the code samples shown here requires that the lung data be loaded and mutated as follows:
library(tidyverse)
library(survival)
library(reportRx)
data(lung)
<- lung %>%
lung mutate(
Status=factor(status-1),
Sex = as.character(factor(sex,labels = c('Male','Female'))),
sex = factor(sex),
OneLevelFactor = factor(x='one level')
)
$Sex[sample(1:nrow(lung),size=10)] <- NA lung