generate.columns.from.date: Generate new columns epiyearweek, epiweek and epiyear from...

Description Usage Arguments Value Examples

View source: R/generate.columns.from.date.R

Description

Function generate.columns.from.date creates new column from original one written in the format YYYY-MM-DD, using Brazilian epidemiological week system

Usage

1
generate.columns.from.date(df.in, target.col)

Arguments

df.in

Data frame object

target.col

Name or position of column with values of type Date or character in the format %Y-%m-%d

Value

generate.columns.from.date returns a new data frame with same columns of df.in plus columns epiyear, epiweek, epiyearweek. epiyearweek has the format %Y'W'%w (e.g., 2009W42)

Examples

1
2
df <- data.frame(list(date=c('2009-08-01', '2009-09-01', '2009-10-01', '2010-01-01')))
df.new <- generate.columns.from.date(df, 'date')

marfcg/leos.opportunity.estimator documentation built on Nov. 21, 2019, 11:07 p.m.