S: Use C-style String Formatting Commands

View source: R/S.R

SR Documentation

Use C-style String Formatting Commands

Description

Convenience wrapper for sprintf that allows recycling of ... of length one.

Usage

S(x, ...)

Arguments

x

A single string containing "%s".

...

A vector of substitutions equal in length to the number of "%s" in x or of length one (if length one ... will be recycled).

Value

Returns a string with "%s" replaced.

See Also

sprintf

Examples

S("@after_", "the", "the")
# Recycle
S("@after_", "the")
S("@rm_between", "LEFT", "RIGHT")

qdapRegex documentation built on Oct. 17, 2023, 5:06 p.m.