printV: printV returns a vector cbinded to 1:length(invect)

View source: R/rutils.R

printVR Documentation

printV returns a vector cbinded to 1:length(invect)

Description

printV takes an input vector and generates another vector of numbers 1:length(invect) which it cbinds to itself. This is primarily useful when trying to print out a vector which can be clumsy to read when print across the screen. applying printV leads to a single vector being printed down the screen

Usage

printV(invect, label = c("value", "index"))

Arguments

invect

the input vector to be more easily visualized, this can be numbers, characters, or logical. If logical the TRUE and FALSE are converted to 1's and 0's

label

the column labels for vector, default is index and value

Value

a dataframe containing the vector 1:length(invect), and invect.

Examples

## Not run: 
vec <- rnorm(10,mean=20,sd=2)
printV(vec)
vec <- letters
printV(vec)
vec <- c(TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE)
printV(vec,label=c("index","logicstate"))

## End(Not run)

haddonm/codeutils documentation built on April 15, 2024, 1:02 p.m.