applyFunPath: Call a path function safely, forwarding script only if...

View source: R/pathFormat.R

applyFunPathR Documentation

Call a path function safely, forwarding script only if supported

Description

Internal helper used by ggwrite, ftwrite, datwrite, and lwrite to call a fun.path function (as returned by pathFormat, or user-supplied) with name, model, subdir, and (if supported) script. This avoids "unused argument" errors when a custom fun.path function does not accept a script argument.

Usage

applyFunPath(
  fun.path,
  name,
  model = NULL,
  script = NULL,
  subdir = NULL,
  quiet = FALSE
)

Arguments

fun.path

A function as returned by pathFormat, or any custom function accepting at least name, model, and subdir arguments.

name

Character string, file name passed to fun.path.

model

Model identifier passed to fun.path.

script

Script identifier. Only forwarded to fun.path if it has a script formal argument.

subdir

Subdirectory passed to fun.path.

quiet

Logical. If TRUE, suppresses messages about ignored model/script arguments. Only forwarded to fun.path if it has a quiet formal argument.

Value

The result of calling fun.path with the applicable arguments.


tracee documentation built on Nov. 24, 2026, 5:07 p.m.