archive | R Documentation |
Archives files from a folder based on modification date. All files within folder are processed based on modification date.
archive(
from,
to = "Archive",
date = Sys.Date(),
dir = FALSE,
string = "",
exclude = NA,
keep = FALSE
)
from |
Path to folder containing files to archive. |
to |
Folder name to archive files to. Default is Archive |
date |
File modification date from which files are to be retained. Files prior to this date are archived. Default is Sys.Date(). |
dir |
Optional logical argument; also archive folders or not. Default is FALSE. |
string |
Optional string pattern in files to archive. |
exclude |
Optional string pattern of files to exclude from archiving |
keep |
Optional retain archived files in original location and copy to archive folder. Default is FALSE. |
Moves older files based on date to an archive subfolder
Diane Hatziioanou
# Move all files excluding folders to an Archive subfolder
# archive("C:..../analysis")
# Move all files excluding folders to a different folder
# archive(from = "C:..../analysis", to = "C:.../backup/outputs")
## Copy all files and folders with the "output_version_x" in the file name
## which have not been modified in the past week to a different folder
# archive(from = "C:..../analysis", to = "C:.../backup/outputs", date = Sys.Date() -7,
# string = "output_version_x", keep = T, dir = T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.