# NOT RUN {
# view head of data.frame to be checked
head(data_blanford, 3)
# specify data.frame and names of columns for;
# time, censor status, infection status
check_data(data = data_blanford,
time = t,
censor = censor,
infected_treatment = inf)
# create data.frame 't_zero' with t = 0 in first row of data.frame
t_zero <- data_blanford
t_zero[1, 8] <- 0
head(t_zero, 3)
check_data(data = t_zero,
time = t,
censor = censor,
infected_treatment = inf)
# correct '0' and make first row of column 'censor' = NA
t_zero[1, 8] <- 1 ; t_zero[1, 5] <- NA ; head(t_zero, 3)
check_data(data = t_zero,
time = t,
censor = censor,
infected_treatment = inf)
# remove row(s) with 'NA'
t_zero_II <- na.omit(t_zero) # NB applies to whole data.frame
check_data(data = t_zero_II,
time = t,
censor = censor,
infected_treatment = inf)
# }
Run the code above in your browser using DataLab