organizeDate: Organize the date-column(s)

Description Usage Arguments Value Examples

View source: R/organizeBirds.R

Description

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

Usage

1
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

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

BIRDS documentation built on June 27, 2021, 1:06 a.m.