organizeDate: Organize the date-column(s)

View source: R/organizeBirds.R

organizeDateR Documentation

Organize the date-column(s)

Description

Organize the date-column(s) in a data.frame to three columns

Usage

organizeDate(x, columns)

Arguments

x

A data.frame with at least the columns specified in 'columns'

columns

A character vector with the column names for the dates specified. It can either be one column formatted as "yyyy-mm-dd" or a vector of length=3. If the column names are "year", "month" and "day" it will take these column names. Otherwise, it will take the column names and interpret the first as year, the second as month and the third as day.

Value

A data.frame with the columns "year", "month", "day"

Examples

ymd<-as.Date(Sys.Date())+1:5
id<-1:5
organizeDate(data.frame("id"=id,
                        "ymd"=as.character(ymd)),
             "ymd")

Greensway/BIRDS documentation built on Oct. 19, 2023, 2:35 a.m.