Skip to contents

Sets the sprintf template used to mint and detect placeholder IDs for unknown parents (see addUIds). The format must have a non-empty literal prefix before its first "%" (used for detection) and must consume a single integer (used for generation), e.g. "U%04d" or "AUTO%05d". The number must print as capital letters or digits, so that the IDs the format makes are recognized as placeholders (see removeAutoGenIds); a format that prints lowercase letters ("U%04x") or pads with spaces ("U%4d") is refused. The setting is stored in options(nprcgenekeepr.autoIdFormat=) and read by getAutoIdFormat.

Usage

setAutoIdFormat(format)

Arguments

format

A single character string: the auto-ID sprintf format.

Value

The previous format, returned invisibly.

Examples

old <- setAutoIdFormat("AUTO%05d")
getAutoIdFormat()
#> [1] "AUTO%05d"
setAutoIdFormat(old) # restore