3
Hello, the scrip below creates a CSV with a Calendar dimension from the year 2015 to the current month. It turns out that I would like the function to return the month before the execution. Ex: If Sys.Data registers 14/11/2017, it returns the date 14/10/2017. Or, if possible, the date 01/10/2017, since the day 01 is the standard on this dCalegendary. 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")
Thank you very much. The suggestion was very good
– George Santiago