R: Conditionally format messages

msg {quanteda} | R Documentation

## Conditionally format messages

### Description

Conditionally format messages

### Usage

    msg(x, values = NULL, indices = NULL, pretty = TRUE, ...)

### Arguments

`x` | message template to be passed to `sprintf()`.
`values` | list of values to be used in the template. Coerced to list if vector is given.
`indices` | list of integer to specify which value to be used.
`pretty` | if `TRUE`, message is passed to `prettyNum()`.
`...` | additional arguments passed to `prettyNum()`.

### Examples

    ## Not run:
    quanteda:::msg("you cannot delete %s",
                   c("a document", "documents"), indices = TRUE)
    quanteda:::msg("tokens has %s",
                   c("sentences", "paragraphs", "documents"), indices = 2)

    dfmat <- data_dfm_lbgexample
    quanteda:::msg("dfm has %d %s and %d %s",
         list(ndoc(dfmat), c("document", "documents"),
              nfeat(dfmat), c("feature", "features")),
         list(1, ndoc(dfmat) > 1,
              1, nfeat(dfmat) > 1))

    ## End(Not run)

[Package quanteda version 3.1.0 Index]