I am exporting graph outputs from R to a pdf file.
I would like to add the Sys.time()
and Sys.Date(
) to the outfile name.
For instance I have a statement
pdf("output filename.pdf", 8,10)
I would like to output to look like
output filename 2010-03-25 2pm.pdf
or something similar.
You could try
Break it into two steps for easy implementation on other docs.
Combine
Sys.time()
with some formatting to get what you want:Formatting options can be found in
?strptime