Skip to content

Instantly share code, notes, and snippets.

@statgeek
Created May 13, 2020 19:16
Show Gist options
  • Save statgeek/25e53c74c73fc7f3cdb7725602cf9e99 to your computer and use it in GitHub Desktop.
Save statgeek/25e53c74c73fc7f3cdb7725602cf9e99 to your computer and use it in GitHub Desktop.
R - Save file with datestamp
# This program illustrates how to save an RDS file with the date in the name
#file name
myfileName <- "exampleData"
#create full file name including date and extension
myfilePath <- paste0(getwd(), "/", myfileName, "_" ,Sys.Date(), ".RDS")
#pass variable to save function
saveRDS(mpg, myfilePath)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment