Skip to contents

Find the most recently modified file in a folder Can use a matching pattern to specify a specific file type or name.

Usage

recent_file(filepath, pattern = NULL, recursive = FALSE, ignore.case = FALSE)

Arguments

filepath

folder to search in to find most recent file

pattern

an optional regular expression. Only file names which match the regular expression will be returned.

recursive

logical. Should the listing look inside subfolders in the filepath? Defaults to FALSE.

ignore.case

logical. Should pattern-matching be case-insensitive? Defaults to FALSE