pymat: Python-style Formatting of Strings.

Description Usage Arguments Examples

Description

This function allows Python-style formatting of strings, whereby text of the form {0}, {1}, ..., {n} is substituted according to the matching argument passed to .... 0 corresponds to the first argument, 1 corresponds to the second, and so on.

Usage

1
pymat(x, ..., collapse = ", ")

Arguments

x

A string with arguments to be replaced in the form of {0}, {1}, ..., {n}.

...

Arguments to be substituted into x.

collapse

If vectors of length greater than 1 are passed to ..., then we collapse the vectors with this separator.

Examples

1
2
3
4
5
6
7
8
9
pymat(
  "My favourite fruits are: {0}, {1}, and {2}.",
  "apple", "banana", "orange"
)

pymat(
  "My favourite fruits are: {0}.",
  c("apple", "banana", "orange"), collapse=", "
)


Search within the Kmisc package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.