Glob file patterns
glob.RdConvenience wrapper around Sys.glob() for file pattern matching. Useful for generating file lists for slurm_map().
Examples
# \donttest{
# Find all CSV files
csv_files <- glob("*.csv")
#> Warning: No files found matching pattern: *.csv
# Find all R scripts in subdirectory
scripts <- glob("scripts/*.R")
#> Warning: No files found matching pattern: scripts/*.R
# Use with slurm_map
if (interactive()) {
files <- glob("data/*.rds")
process_file <- function(x) x # stub for example
jobs <- slurm_map(files, process_file, .engine = "local")
}
# }