fnAppend: paste something before file name extension.

View source: R/fnAppend.R

fnAppendR Documentation

paste something before file name extension.

Description

Append a file name like file.mod to file_1.mod or file_pk.mod. If it's a number, we can pad some zeros if wanted. The separator (default is underscore) can be modified.

Usage

fnAppend(fn, x, pad0 = 0, sep = "_")

Arguments

fn

The file name to modify

x

A character string or a numeric to add to the file name

pad0

In case x is numeric, a number of zeros to pad before the appended number. This is useful if you are generating say more than 10 files, and your counter will be 01, 02,.., 10,... and not 1, 2,...,10,...

sep

The separator between the existing file name (until extension) and the addition.

Value

A character (vector)


NMdata documentation built on Nov. 11, 2023, 5:07 p.m.