split_datetimes | R Documentation |
These functions can split the "date" and "time" components of POSIXt columns and the "hour", "month", and "day" components of Date columns into multiple columns.
split_datetimes(data, cols = NULL, class = c("character", "date"))
split_dates(data, cols = NULL)
data |
input dataframe |
cols |
set of columns to apply transformation to. If |
class |
For |
a dataframe
Jack Davison
Other Messy date(time) functions:
messy_datetime_formats()
,
messy_datetime_tzones()
# split datetimes
data <- data.frame(today = Sys.time())
split_datetimes(data)
# split dates
data <- data.frame(today = Sys.Date())
data
split_dates(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.