namer: Function to create file name (path) string.

View source: R/namer.R

namerR Documentation

Function to create file name (path) string.

Description

A file path is created in the form <dir>/<prequel><arg><ext>.

Usage

namer(
  dir = NULL,
  prequel = NULL,
  arg = NULL,
  sep = getOption("sep"),
  ext = NULL
)

Arguments

dir

A directory to which the path should point to.

prequel

Prequel that is appended to the file name (e.g. '~/project').

arg

A named list or vector of arguments that are used for creating the file name. Once created, they can be extracted with denamer().

sep

String that separates names and entries of the arg (Default: <_>).

ext

Should a file extension be added at the end of the string? (e.g. .png)?

Author(s)

Andreas Scharmueller, andschar@proton.me

Examples

namer(dir = tempdir(),
      prequel = 'test-prequel',
      arg = list(weight = 12,
                 color = 'white'),
      sep = '_',
      ext = '.png')


andschar/andmisc documentation built on Jan. 19, 2025, 10:46 a.m.