add_date_cols | R Documentation |
Add columns to a data frame with information extracted from the indicated date column
add_date_cols(df, dt_col, cols)
df |
data frame that has the date column |
dt_col |
name of the column with the dates of interest |
cols |
columns to add, currently "year","yr","month","week","day", "weekday","month_name","month_abb","weekday_name","weekday_abb" |
same data frame with added columns
df<-data.frame(date=sample(seq(as.Date('2010/01/01'), as.Date('2019/12/31'), by="day"), 30))
add_date_cols(df,"date")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.