Description Usage Arguments Value Examples
Creates a continuous Unit-Time-Dummy data frame from a data frame with Unit-Start-End times
1 2 |
data |
a data frame with a Group, Start, and End variables. |
GroupVar |
a character string naming the variable grouping the units within which the new dummy variable will be found. |
StartVar |
a character string indicating the variable with the starting times of some series. |
EndVar |
a character string indicating the variable with the ending times of some series. |
NewVar |
a character string specifying the name of the new dummy
variable for the series. The default is |
NewTimeVar |
a character string specifying the name of the new time
variable. The default is |
KeepStartStop |
logical indicating whether or not to keep the
|
Returns a data frame with at least three columns, with the
GroupVar
, NewTimeVar
, and a new dummy variable with the name
specified by NewVar
. This variable is 1
for every time
increment between and including StartVar
and EndVar
. It is
0
otherwise.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Create fake data
country = c('Panama', 'Korea', 'Korea', 'Germany', 'Finland')
start = c(1995, 1980, 2004, 2000, 2012)
end = c(1995, 2001, 2010, 2002, 2014)
Data <- data.frame(country, start, end)
# TimeFill
FilledData <- TimeFill(Data, GroupVar = 'country',
StartVar = 'start', EndVar = 'end')
# Show selection from TimeFill-ed data
FilledData[90:100, ]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.