ps_separate_datetime.Rd
Separates DateTime into Year, Month and Day.
ps_separate_datetime(
data,
col = "DateTime",
into = c("Year", "Month", "Day", "Hour", "Minute", "Second"),
remove = TRUE
)
A data frame.
A column name or position.
A character vector of length 6 specifying the names for the year, month, day, hour, minute and second components.
A flag specifying whether to remove the original column.
data <- data.frame(DateTime = Sys.time())
ps_separate_datetime(data)
#> Year Month Day Hour Minute Second
#> 1 2022 5 19 2 6 30