Hi everyone,
I'm trying to get some inherited code to work with my data and I am unable to determine why I am receiving the following error messages when using output$SURVPLOT
The warning in the console -> Warning: Error in findrow: no points selected for one or more curves, consider using the extend argument
The warning in the shiny app window when trying to generate the graph -> Error: no points selected for one or more curves, consider using the extend argument
Has anyone seen this errors before and know what they mean?
I am fairly sure it is linked to the below chunk of the code as other text outputs are produced. Just not the graph..
output$SURVPLOT <- renderPlot({
surv_curve_all() %>%
filter(time<surv_months) %>%
filter(type=="obs" | type=="Patient") %>%
mutate(surv=surv*100) %>%
ggplot() +
geom_step(aes(x=time,y=surv, linetype=type, color=rg)) +
scale_colour_brewer(type = "seq", palette = "Set1") +
ylim(0,100) + xlab("Time (months)") + ylab("Survival %") +
theme_bw() +
labs(color="Risk Group") + scale_size(guide=FALSE) +
scale_linetype_discrete(name = "",labels = c("Observed","Patient"))
This is the relevant code before the output$SURVPLOT code.
surv_curve_all <- reactive({
rbind(surv_curve_alldata_imp_df,
data.frame(time=survfit_pred_survcurve()$time,
surv=survfit_pred_survcurve()$surv,
rg=rep("Patient",nrow(survfit_pred_survcurve())),
type=rep("Patient",nrow(survfit_pred_survcurve()))
Would really appreciate any help with the resolving the error messages. Can provide more info if needed, any help would be appreciated.
Thanks