I need R to tell me the month before we are, that is, we are in "2018-05" and I need him to give me "2018-04". So far my solution was:
format(Sys.Date()-as.integer(format(Sys.Date(), "%d")),"%Y-%m")
I believe there should be a more "clean" solution.