I want to preallocate space for dates in an R dataframe.
To preallocate space for characters and numbers, I would write
MyDataframe <- data.frame(Name = character(10),
Tickets = numeric(10))
What would I add next to preallocate space for dates? This does not work...
# DOES NOT WORK
MyDataframe <- data.frame(Name = character(10),
Tickets = numeric(10)
Date = Date(10))
Currently, I define the column as numeric, then coerce to dates, but this seems less than ideal.
Thanks