combine_date_time_cols {epocakir}R Documentation

Combine date and time columns into a single DateTime column

Description

Combine date and time columns into a single DateTime column

Usage

combine_date_time_cols(.data, tz = NULL)

Arguments

.data

(data.frame) A data frame or data frame extension (e.g. a tibble)

tz

(character) a time zone name (default: time zone of the POSIXt object x)

Value

(data.frame) An object of the same type as .data

Examples

df <- data.frame(
  date_a = as.Date(c("2020-01-01", "2020-01-02")),
  date_b = as.POSIXct(c("2020-02-01", "2020-02-02")),
  time_a = as.POSIXct(c("1900-01-01 01:01:01", "1900-01-01 02:02:02")),
  time_b = as.POSIXct(c("1900-01-01 01:01:01", "1900-01-01 02:02:02"))
)

combine_date_time_cols(df)

[Package epocakir version 0.9.9 Index]