-
Notifications
You must be signed in to change notification settings - Fork 169
Description
-
in the function ggforest there is the expression
vars = grep(paste0("^", var, "*."), coef$term, value = TRUE)
data.frame(var = vars, Var1 = "", Freq = nrow(data),
pos = seq_along(vars)) -
with a model like this
coxph(formula = as.formula(sprintf("Surv(OS, OS_Status) ~ %s",
paste(c("add11", "minus18", "add17", "del7q"), collapse = "+"))),
data = data)coef exp(coef) se(coef) z p add11TRUE 0.8 2.1 0.5 1.6 0.107 minus18TRUE -0.3 0.7 0.5 -0.7 0.503 add17TRUE 0.3 1.3 0.5 0.5 0.589 del7qTRUE 1.1 3.1 0.4 3.0 0.003
The expression grep(paste0("^", var, "*."), coef$term, value = TRUE) ~
is equivalent for the first term to:
grep("^add11*.", coef$term, value=T)
[1] "add11TRUE" "add17TRUE"
and we obtain two values and subsequently the graphic is not correct
maybe we can change by grep(paste0("^", var, "TRUE|^",var,"FALSE"), coef$term, value = TRUE) to obtain only the add11. This code only executes for boolean variables.
testing
var="add11"
grep(paste0("^", var, "TRUE|^",var,"FALSE"), c("add11TRUE","add17TRUE"), value=T)
[1] "add11TRUE"