file_recent: Find the Recentmost File by File Name

View source: R/file_recent.R

file_recentR Documentation

Find the Recentmost File by File Name

Description

This function takes a list of files with their full paths and returns the recentmost file by the name and the date embedded in the file name. If necessary, you can also use the outputs of 'file.info' function.

Usage

file_recent(
  path_list,
  pattern = "_([0-9]+).txt$",
  date_format = "%Y%m%d",
  filter_cols = NULL,
  filter_conds = NULL
)

Arguments

path_list

List of files to investigate with their full path

pattern

Pattern of date in file names. Defaults to "_([0-9]+).txt$".

date_format

Format of the date, esp. their order. Defaults to "%Y%m%d".

filter_cols

If there are additional conditions that need to be met (dplyr::filter), specify the columns here. If multiple columns, as list.

filter_conds

If there are additional conditions that need to be met (dplyr::filter), specify the conditions here. If multiple columns, as list. This will be used with the %in% operator.


sysilviakim/Kmisc documentation built on Jan. 28, 2023, 10:58 a.m.