ps_separate_datetime: Separate DateTime

ps_separate_datetimeR Documentation

Separate DateTime

Description

Separates DateTime into Year, Month and Day.

Usage

ps_separate_datetime(
  data,
  col = "DateTime",
  into = c("Year", "Month", "Day", "Hour", "Minute", "Second"),
  remove = TRUE
)

Arguments

data

A data frame.

col

A column name or position.

into

A character vector of length 6 specifying the names for the year, month, day, hour, minute and second components.

remove

A flag specifying whether to remove the original column.

Examples

data <- data.frame(DateTime = Sys.time())
ps_separate_datetime(data)

poissonconsulting/poisix documentation built on May 28, 2022, 10:42 p.m.