Last active
July 6, 2021 12:20
-
-
Save StefanThoma/019bda58a6cefe7cc80e7f9877432a3b to your computer and use it in GitHub Desktop.
Check if File exists. If not, create it and save.
This file contains 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
filename <- paste("file", ".csv", sep = "") | |
if(filename %in% list.files()){ | |
# Load files | |
df <- read_csv(filename) | |
} else{ | |
# create df | |
# save df | |
write_csv(df, filename) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment