Created
May 13, 2020 19:16
-
-
Save statgeek/25e53c74c73fc7f3cdb7725602cf9e99 to your computer and use it in GitHub Desktop.
R - Save file with datestamp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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