extract_dt_comp: Extract date component from a date-time variable

View source: R/extract_dt_comp.R

extract_dt_compR Documentation

Extract date component from a date-time variable

Description

This function extracts a specific date component from a date-time variable in a dataframe.

Usage

extract_dt_comp(data, var, comp, name = NULL)

Arguments

data

The dataframe containing the date-time variable.

var

The name of the date-time variable to extract the component.

comp

The date component wanted from the variable. See iNZightTools:::inz_dt_comp for the full list of components.

name

The name of the new column to store the extracted date component.

Value

A dataframe with the new date component column.

Author(s)

Zhaoming Su


iNZightTools documentation built on Oct. 12, 2023, 5:06 p.m.