Reputation: 2201
I am wondering is it possible to add a timestamp also known as DateTime
column to a data frame definition (i.e. append the column post creation); if not what are the alternatives?
Note: timestamp column has not be defined correctly; therefore this code is not reproducible.
results <- tibble(timestamp = DateTime?,
comment = character(),
model = character(),
RMSE = double())
Upvotes: 3
Views: 2215
Reputation: 28825
I think this addresses your question:
library(tibble)
results <- tibble( timestamp = as.POSIXct(character()),
comment = character(),
model = character(),
RMSE = double())
results
# # A tibble: 0 x 4
# # ... with 4 variables: timestamp <dttm>, comment <chr>,
# # model <chr>, RMSE <dbl>
Upvotes: 2