TimeExpand: Expands a data set so that it includes an observation for each time point in
a sequence. Works with grouped data.
Description
Expands a data set so that it includes an observation for each time point in
a sequence. Works with grouped data.
Usage
TimeExpand(data, GroupVar, TimeVar, begin, end, by = 1)
Arguments
data
a data frame.
GroupVar
the variable in data that signifies the group
variable.
TimeVar
the variable in data that signifies the time variable.
The sequence will be expanded between its minimum and maximum value if
begin and end are not specified.
begin
numeric of length 1. Specifies beginning time point.
Only relevant if end is specified.
end
numeric of length 1. Specifies ending time point.
Only relevant if begin is specified.
by
numeric or character string specifying the steps in the
TimeVar sequence. Can use "month", "year" etc for
POSIXt data.