vecprint: Internal Function: Create Vector to Print

Description Usage Arguments Value Author(s) Examples

View source: R/vecprint.R

Description

This function takes an input vector and outputs a character string with line breaks inserted so that, whenever possible, no line in the string exceeds the input value n.char, which is set to 78 characters by default. The input vector is coereced to mode character. When an element of the input vector is greater than n.char characters in length, then that element is inserted in the output character string as an individual line.

Usage

1
vecprint(x, n.char = 78)

Arguments

x

Character vector.

n.char

The maximum number of characters per line. The default is 78.

Value

Character string that is suitable for printing by the functions: stop, warning, or cat.

Author(s)

Tom Kincaid Kincaid.Tom@epa.gov

Examples

1
2
3
4
5
6
7
8
sites <- paste("Site Number", 1:50)
sites.str <- vecprint(sites)
cat(sites.str)

temp <- c(1, 5, 21:25, 33:37)
sites.str <- vecprint(sites[temp])
warning(paste("\nThe following site ID values were removed from the
  analysis:\n", sites.str, sep=""))

mhweber/spsurvey documentation built on Sept. 17, 2020, 4:24 a.m.