Is there a workaround that allows for using the dygraphs
package in R Shiny
with fractional timepoints? While I know this package is primarily designed for time-series data, I believe it could also be valuable for creating survival plots.
For instance, consider the following dataset:
samp.data <- data.frame(Months=seq(0,10,by=0.5), Surv=seq(1,0,length.out=21))
head(samp.data)
Months Surv
1 0.0 1.00
2 0.5 0.95
3 1.0 0.90
4 1.5 0.85
5 2.0 0.80
6 2.5 0.75
I am aware of the following approach:
samp.xts <- xts(samp.data[,-1], order.by=as.Date(samp.data[,1]))
dygraph(samp.xts)
However, this method omits some details and displays the x-axis as a date instead of a numerical value. After exploring the 'dygraphs' javascript library, I have noticed that it supports non-time-series data as well. Unfortunately, I have not yet discovered any functionality related to the R
package. Is there a way to invoke a javascript
code from within the function?