Description Usage Arguments Value Examples
Returns the timestamp of the most recently modified file. If no such file
exists, or if the directory basepath/fname
doesn't exist, returns NA.
1 | mostRecentTimestamp(fname, basepath = ".")
|
fname |
The name of the directory in |
basepath |
A string. The path which stores the |
A POSIXct object specifying the mtime
of the most recently
modified file in basepath/fname
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(lubridate)
saveRDS(mtcars, 'cars')
saveRDS(mtcars, 'cars')
# Some time elapses...
# Decide if the latest version of 'mtcars' is "too old"
if (mostRecentTimestamp('mtcars') %--% now() > hours(24)) {
# Store a "new" version
saveRDS(mtcars, 'cars')
} else {
cached_mtcars <- retrieveRDS('mtcars')
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.