This function tests whether a single file has a modification date equal to
the system date. Useful when repeatedly running code with a lengthy download
stage. Many state databases are updated daily, so new data can be helpful but
not always necessary. Set this function in an if
statement.
this_file_new(path)
The path to a file to check.
logical; Whether the file has a modification date equal to today.
tmp <- tempfile()
this_file_new(tmp)
#> Warning: file does not exist, proceeding.
#> [1] FALSE