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

expandPredR Documentation

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(x, Time = "Time", predTime, time.col = FALSE)

Arguments

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

Value

data.frame expanded by predTime

Author(s)

Devin S. Johnson

Examples


#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)


NMML/crawl documentation built on Oct. 9, 2024, 11:56 a.m.