Description Usage Arguments Value Examples
takes as input a date.frame object (dfName
), a column name (dfColName
), and the date format (dateFormat
) of the column dfColName
and inserts a new column containing the week of the year corresponding to the entries in the column dfColName
. The location of the new column is dictated by endRep
.
1 | weekYCol(dfName, dfColName, dateFormat, endRep = "end")
|
dfName |
a string of class character indicating the name of the data.frame object to be used |
dfColName |
a string of class character indicating the name of the column to be handled. The entries in this column must be dates in the date format given by the parameter |
dateFormat |
a character string indicating the date format of the column |
endRep |
a character string (default: "end") indicating whether to append the new columns at the end (endRep=="end") or replace the original columns with the respective new columns (endRep=="rep") or insert the new columns right after the respective columns (endRep=="after") in the data.frame object with name |
the modified data.frame object dfName
which now contains a new column containing the week of the year corresponding to the entries in column dfColName
of the original data frame. 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.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.