Date_Roller | R Documentation |
Creates a list of rolling date entries to be used easily using a map call. It will start at first date, look ahead N periods and create the first list entry. Thereafter it drops first entry, and adds next. This keeps a constant N length rolling window. See my question on stack here: https://stackoverflow.com/q/54733427/4198868
Date_Roller(DateVec, N = 24)
DateVec |
Any arranged vector of dates. Function will sort your date vector just in case you forget... |
N |
Rolling N periods. |
Vector of dates to be used in map.
library(tidyverse);library(lubridate);library(rmsfuns)
DateVec <- rmsfuns::dateconverter(lubridate::ymd(20020101), lubridate::ymd(20200131), Transform = "weekdayEOM")
Rolldates <- Date_Roller(DateVec, N = 24)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.