jprint: print multiple values joined together

Description Usage Arguments Details Examples

View source: R/jprint.R

Description

print multiple values joined together

Usage

1
jprint(..., sep_atomic = " ", sep_vector = ", ")

Arguments

...

variadic parameter to of objects to combine

sep_atomic

separator value between each atomic element

sep_vector

separator value for collapsed vectors

Details

print can only take one value to be printed, this function j(oined)print provides a wrapper to obviate the need to do print(paste0(...)) type work-arounds

This is especially valuable for messages where output can be single element or a vector/list (for example, a list of missing column names), as the internal vector/list can be collapsed to a single string via a different pattern than how the various elements are combined.

Examples

1
2
3
4
5
6
7
result <- "world"
jprint("hello", result)

missing_cols <- c("WT", "HT", "OCC") #would normally actually calculate this
jprint("missing columns: ", missing_cols)
jprint("missing columns: ", missing_cols, sep_vector=";")
jprint("missing cols", missing_cols, sep_atomic=":")

PKPDmisc documentation built on April 14, 2020, 5:49 p.m.