This function extracts a specific date component from a date-time variable in a dataframe.
extract_dt_comp(data, var, comp, name = NULL)
A dataframe with the new date component column.
The dataframe containing the date-time variable.
The name of the date-time variable to extract the component.
The date component wanted from the variable. See
iNZightTools:::inz_dt_comp
for the full list of components.
The name of the new column to store the extracted date component.
Zhaoming Su