weekYColColsTabs: weekYColColsTabs

Description Usage Arguments Value Examples

View source: R/weekYColColsTabs.R

Description

takes as input a vector containing date.frame object names (dfNameVec), and a vector containing column names (dfColNameVec) and inserts a new column in each data frame for each column in dfColNameVec containing the week of the year corresponding to the entries in that column

Usage

1
weekYColColsTabs(dfNameVec, dfColNameVec)

Arguments

dfNameVec

a string or a vector of class character indicating the name(s) of the data.frame object(s) to be used.

dfColNameVec

a string or a vector of class character indicating the name(s) of the column(s) to be handled. The entries in each of these columns must be dates in the date format "dd.mm.yyyy".

Value

the modified data.frame objects which now contain new columns containing the week of the year corresponding to the entries in the respective columns specified by dfColNameVec of the original data frames. The entries in the new column are integers in the range [1,53]. If 1 January falls on either of Monday, Tuesday, Wednesday, Thursday then it belongs to week 1, otherwise week 53 of the last year. The first week of the year is the one that contains the first Thursday of the year.

Examples

1
2
3
weekYColColsTAbs(c("rice","maize"),c("tillDate","plantDat","hrvDate"))
weekYColColsTabs(c("students"),c("start_date","date_of_birth"))
weekYColColsTabs("students",c("start_date","date_of_birth"))

lwTools/agriTrf documentation built on March 26, 2020, 12:09 a.m.