normalize_datetime: Normalize Datetimes

View source: R/normalize_datetimes.R

normalize_datetimeR Documentation

Normalize Datetimes

Description

This function takes in datetime data that is collected under different timezones, and normalizes them to the same time zone. This function is needed because R does not allow multiple timezones in a vector.

Usage

normalize_datetime(
  df,
  datecol = "SampleStartDate",
  timecol = "SampleStartTime",
  tzcol = "SampleStartTZ",
  target_tz = "America/Los_Angeles",
  norm_time_colname = "datetime",
  vector_only = FALSE
)

Arguments

df

dataframe to modify.

datecol

Name of the column that contains date values.

timecol

Name of the column that contains time values.

tzcol

Name of column that contains timezone values.

target_tz

Timezone data should be normalized to.

norm_time_colname

Name of column new data should be written to.

vector_only

If true, return only a vector of normalized datetimes. IF false, return dataframe with added datetime


TravisPritchardODEQ/IRLibrary documentation built on April 15, 2024, 9:03 a.m.