library(survival)
a_survival_tree<-
survival_tree(
survival_outcome=Surv(time,status==2)~1,
numeric_predictor=~age+ph.ecog+ph.karno+pat.karno+meal.cal,
factor_predictor=~as.factor(sex),
data=lung)
plot_survival_tree(a_survival_tree)
Run the code above in your browser using DataLab