# NOT RUN {
if (!exists("ctstantestfit")) example(ctstantestfit)
#Basic
ctKalman(ctstantestfit, timerange=c(0,60), plot=TRUE)
#Multiple subjects, y and yprior, showing plot arguments
plot1<-ctKalman(ctstantestfit, timerange=c(0,60), timestep=.1, plot=TRUE,
subjects=2:3,
kalmanvec=c('y','yprior'),
errorvec=c(NA,'ypriorcov')) #'auto' would also have achieved this
#modify plot as per normal with ggplot
print(plot1+ggplot2::coord_cartesian(xlim=c(0,10)))
# }
Run the code above in your browser using DataLab