print multiple values joined together

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

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