Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

message_chk

Construct Tidyverse Style Message


Description

If tidy = TRUE constructs a tidyverse style message by

Usage

message_chk(..., n = NULL, tidy = TRUE)

Arguments

...

Multiple objects that are converted to a string using paste0(..., collapse = '').

n

The value of n for converting sprintf-like types.

tidy

A flag specifying whether capitalize the first character and add a missing period.

Details

  • Capitalizing the first character if possible.

  • Adding a trailing . if missing.

Also if n != NULL replaces the recognized sprintf-like types.

Value

A string of the message.

sprintf-like types

The following recognized sprintf-like types can be used in a message:

n

The value of n.

s

” if n == 1 otherwise 's'

r

'is' if n == 1 otherwise 'are'

y

'y' if n == 1 otherwise 'ie'

Examples

message_chk("there %r %n", " problem director%y%s")
message_chk("there %r %n", " problem director%y%s", n = 1)
message_chk("There %r %n", " problem director%y%s.", n = 3)

chk

Check User-Supplied Function Arguments

v0.5.1
MIT + file LICENSE
Authors
Joe Thorley [aut, cre] (<https://orcid.org/0000-0002-7683-4592>), Kirill Müller [aut] (<https://orcid.org/0000-0002-1416-3412>), Ayla Pearson [ctb] (<https://orcid.org/0000-0001-7388-1222>), Poisson Consulting [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.