when i use the “DynNom“” package which is attached in "shiny" to establish dynamical nomogram with function coxph() in "survival" package, an error is reported in Rstudio, just as follow:
#my code :
> osf1 <- coxph(formula= Surv(time, os==1) ~ Age + Marital + Metastasis + Surgery + Radiatherapy + Lymphnodes_status + Size + Chemotherapy + Hispanic + Lymphnodes_Examined ,data= ess1)
> DynNom(osf1,ess1)
# and the error is :
Listening on http://127.0.0.1:3191
Warning: Error in <-: replacement has length zero
49: server
Error in i.numeric[dim(i.numeric)[1], 3] <- which(names(data) == i.numeric[dim(i.numeric)[1], :
replacement has length zero
# in the formula, besides Age is numeric variable, all of others are factor variables
Strangely, when i use the function cph() to do cox regression meodel, the code is run successfully, the code is as follow:
> osf1 <- cph(formula= Surv(time, os==1) ~ Age+ Marital + Metastasis + Surgery + Radiatherapy + Lymphnodes_status + Size + Chemotherapy + Hispanic + Lymphnodes_Examined, x=T,y=T,surv= T,data = ess1)
> DynNom(osf1,ess1)
my question is: what the errorr means and what can i do to solve this problem, i'd appreciated very much if you can give your hand to me. Thanks!!!