time2year: Convert a time column to year column

View source: R/clean_times2.R

time2yearR Documentation

Convert a time column to year column

Description

A time named column in a data.frame that is a Date object is converted to year column that is a numeric column.

Usage

time2year(x)

Arguments

x

A data.frame

Value

A data.frame

Examples


x <- data.frame(time = as.Date(c("2020-01-01", "2021-01-01", "2022-01-01")), a = c(1,2,3))
time2year(x)


pttry/statfitools documentation built on Feb. 2, 2025, 1:50 a.m.