Learn R Programming

crawl (version 1.0-1)

expandPred: Expand a time indexed data set with additional prediction times

Description

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.

Usage

expandPred(origTime, x, predTime)

Arguments

origTime
Original time index for the data to be expanded.
x
Data to be expanded.
predTime
prediction times to expand data.

Value

  • data.frame expanded by predTime.

Examples

Run this code
origTime <- c(1:10)
x <- cbind(rnorm(10), c(21:30))
predTime <- seq(1,10, by=0.25)
expandPred(origTime, x, predTime)

Run the code above in your browser using DataLab