I'm trying to automatically name a jpg output using a character list. This is an Rmarkdown file I use for reporting. For each month I summarise groundwater statistics and produce a basic Rmardown html. I automatically save the maps to a folder I specify in the script. The maps always have the name GLmap.jpg. I would like to use an appropriate name such as the year and month. Is there a way to do this?? Here's what I've tried so far
Library(tmap)
data("World")
test_map <- tmap::tm_shape(World)+
tmap::tm_polygons("HPI")
Now I specify the year and month that I want
Curdate <- Sys.time() %m+% months(-1)
Curedatemnyr <- as.character(format(Curdate, '%Y %B'))
Now I try to save it with a name that references by year and month
tmap::tmap_save(test_map,"'Curedatemnyr'_GLmap.jpg")
This doesn't reference the year and month from the list just gives the exact name i.e. 'Curedatemnyr'_GLmap.jpg instead of 2020 March_GLmap.jpg.
Any ideas??