expandPred | R Documentation |
Expands a covariate data frame (or vector) that has a separate time index by inserting prediction times and duplicating the covariate values for all prediction time between subsequent data times.
expandPred(x, Time = "Time", predTime, time.col = FALSE)
x |
Data to be expanded. |
Time |
Either a character naming the column which contains original time values, or a numeric vector of original times |
predTime |
prediction times to expand data |
time.col |
Logical value indicating whether to attach the new times to the expanded data |
data.frame expanded by predTime
Devin S. Johnson
#library(crawl)
origTime <- c(1:10)
x <- cbind(rnorm(10), c(21:30))
predTime <- seq(1,10, by=0.25)
expandPred(x, Time=origTime, predTime, time.col=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.