newestFile: Return the newest file from a vector of files

newestFileR Documentation

Return the newest file from a vector of files

Description

Return the newest file from a vector of files

Usage

newestFile(x, timecol = "mtime", n = 1, ...)

Arguments

x

character vector of files, specifying file path where required.

timecol

character value from the output of base::file.info() indicating the time column used to order files. By default "mtime" refers to the time the file was last modified.

n

integer number of files to return, in order of the most recent to the least recent. By default n=1 returns only the one newest file.

...

additional parameters are ignored.

Details

This function returns the newest file, defined by the most recently modified time obtained from base::file.info().

Value

Character vector length=1 of the most recently modified file from the input vector x. Note that any files not found are removed, using base::file.exists().

See Also

Other jam practical functions: breakDensity(), checkLightMode(), check_pkg_installed(), colNum2excelName(), color_dither(), diff_functions(), exp2signed(), fileInfo(), fixYellow(), getAxisLabel(), handleArgsText(), heads(), isFALSEV(), isTRUEV(), jamba, jargs(), kable_coloring(), lldf(), log2signed(), make_html_styles(), make_styles(), match_unique(), mergeAllXY(), middle(), minorLogTicks(), printDebug(), renameColumn(), rmInfinite(), rmNAs(), rmNA(), rmNULL(), sclass(), sdim(), setPrompt()

Examples

newestFile(list.files());


jmw86069/jamba documentation built on March 26, 2024, 5:26 a.m.