truncMessage: truncate message parts

View source: R/truncMessage.R

truncMessageR Documentation

truncate message parts

Description

truncate long vectors for messages

Usage

truncMessage(
  x,
  ntrunc = 3,
  prefix = "s",
  midfix = " ",
  altnix = "'",
  sep = ", "
)

Arguments

x

Character vector

ntrunc

Integer: number of elements printed before truncation. DEFAULT: 3

prefix

Character: Prefix added if length(x)>1. DEFAULT: "s"

midfix

Character: string added after prefix OR before first altnix. DEFAULT: " "

altnix

Character: Alternative string padded around x if length(x)==1. DEFAULT: "'"

sep

Character: Separator between elements. DEFAULT: ", "

Value

Character string

Author(s)

Berry Boessenkool, berry-b@gmx.de, Nov 2016

See Also

message

Examples

truncMessage("hi")
message("listing name", truncMessage(       "hi"      ), ".")
message("listing name", truncMessage(paste0("hi",1:10)), ".")
truncMessage(paste0("hi",1:10), ntrunc=1)
truncMessage(paste0("hi",1:10), ntrunc=2, prefix="", midfix="")
truncMessage(paste0("hi",1:10), ntrunc=8, prefix="files _ ")


berryFunctions documentation built on May 29, 2024, 4:01 a.m.