Get the final result of the check
get_result(obj, group_id = T)
obj | An object. Can be all classes: short, lab, date. |
---|---|
group_id | A logical scalar, default is TRUE.True is grouped by id, otherwise, it isn't grouped. |
A data frame. The final result.
id <- c("01", "02", "03") site <- c("site 01", "site 02", "site 03") sex <- c("f", "m", "f") preg_yn_e2 <- c("y", "y", "y") preg_res_e2 <- c("neg", "neg", "neg") preg_yn_e3 <- c("y", "y", "n") preg_res_e3 <- c("neg", "pos", "unnes") df <- data.frame( id, site, sex, preg_yn_e2, preg_res_e2, preg_yn_e3, preg_res_e3, stringsAsFactors = FALSE ) preg <- system.file("preg.xlsx", package = "dmtools") obj_short <- short(preg, id, "LBORRES", c("site", "sex")) obj_short <- check(obj_short, df) get_result(obj_short)#> id site sex LBPERF LBORRES IDVAR VISIT #> 1 01 site 01 f y neg preg_res _e2 #> 2 01 site 01 f y neg preg_res _e3 #> 3 02 site 02 m y neg preg_res _e2 #> 4 02 site 02 m y pos preg_res _e3 #> 5 03 site 03 f y neg preg_res _e2 #> 6 03 site 03 f n unnes preg_res _e3