vectorShow: Show some values from a vector

Description Usage Arguments Value Author(s) Examples

View source: R/misc.R

Description

This is similar to str(), but it shows data at the first and last of the vector, which can be quite helpful in debugging.

Usage

1
vectorShow(v, msg = "", postscript = "", digits = 5, n = 2L)

Arguments

v

the vector.

msg

optional character value indicating a message to show, introducing the vector. If not provided, then a message is created from v. If msg is a non-empty string, then that string is pasted together with a colon (unless msg already contains a colon), before pasting a summary of data values.

postscript

optional character value indicating an optional message to append at the end of the return value.

digits

for numerical values of v, this is the number of digits to use, in formatting the numbers with format(); otherwise, digits is ignored.

n

number of elements to show at start and end. If n is negative, then all the elements are shown.

Value

A string ending in a newline character, suitable for display with cat() or oceDebug().

Author(s)

Dan Kelley

Examples

1
2
3
4
5
vectorShow(pi)
vectorShow(volcano)
knot2mps <- 0.5144444
vectorShow(knot2mps, postscript="knots per m/s")
vectorShow("January", msg="The first month is")

oce documentation built on March 28, 2021, 9:09 a.m.