Hello, the script below creates a CSV with a Calendar dimension from year 2015 to the current month. I happen to want the function to return the month before execution. Ex: If Sys.Data records 14/11/2017, it returns the date 10-14-2017. Or, if possible, the date 01/10/2017, since day 01 is the default in this calendar. NOTE: If you prefer, you can suggest creating another script
tabela_tcm_dCalendario <- list(mes = 1:12, ano = 2015:2017) %>%
purrr::cross_df() %>%
dplyr::mutate(data = as.Date(sprintf("%d-%02d-01", ano, mes))) %>%
dplyr::filter(data < Sys.Date())
readr::write_csv("parametros_scraping/tabela_tcm_dCalendario.csv")