Dasst-addDate: Add date class to objects of class Dasst

Description Arguments Details Value Examples

Description

addDate<- adds a column of class date to tables of the object of class Dasst.

Arguments

x

An object of class Dasst.

...

Other parameters: format, character vector encoding the date format;

value

A formula, numeric vector or character vector. Order of the column fields from where dates can be composed.

Details

This method adds a column of class date to tables of the object of class Dasst. Dates expressed as string or integers may be converted and stored as date objects in a new column whose name begins with "date_" and follows with the names of column fields involved in the date extraction.

So far, the new column will not be saved if the write method is invoked.

Value

The actual object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(plantGrowth)
addDate(plantGrowth) <- ~ YEAR + DOY

# or
addDate(plantGrowth) <- c("YEAR", "DOY")

# or
addDate(plantGrowth) <- c(1, 2)

# Only one tables 1 and specifying date format
addDate(plantGrowth, index=c(1,2), format="%Y%j") <- ~ YEAR + DOY

hlozza/Dasst documentation built on Nov. 23, 2017, 7:37 p.m.