Closed wangben718 closed 10 months ago
bug fix:
forestly_adsl_mod <- forestly_adsl |> dplyr::mutate( TRT01A = ifelse(USUBJID == "01-718-1355", "", TRT01A), TRTA = factor(TRT01A, levels = c("Xanomeline Low Dose", "Placebo"), labels = c("Low Dose", "Placebo")) )
forestly_adae_mod <- forestly_adae |> dplyr::filter(USUBJID != "01-718-1355")
factor(forestly_adae_mod$TRTA, levels = forestly_adsl_mod$TRTA)
This approach will make "Xanomeline Low Dose" to NA since "Low Dose" could not be found in forestly_adae_mod$TRTA as input of factor().
"Xanomeline Low Dose"
NA
"Low Dose"
forestly_adae_mod$TRTA
factor()
forestly_adae_mod$TRTA <- factor(forestly_adae_mod$TRTA, levels(forestly_adsl_mod$TRTA)) levels(forestly_adae_mod$TRTA) <- levels(forestly_adsl_mod$TRTA)
This approach works well.
bug fix:
This approach will make
"Xanomeline Low Dose"
toNA
since"Low Dose"
could not be found inforestly_adae_mod$TRTA
as input offactor()
.This approach works well.