catty: Construct a catty vector

View source: R/catty.R

cattyR Documentation

Construct a catty vector

Description

catty() constructs a catty vector (of class zmisc_catty). A catty vector is a character vector that uses cat() for print output, rather than the standard print() command. Apart from this, it behaves like a standard character vector.

Objects of this class are convenient return values for functions that should generally just print a desired value without the index information of a normal print command. This is what happens if a function returning a catty object is called interactively. However, the return value can also be assigned to a variable for later use, making this more flexible than having the function output the text directly.

Usage

catty(x, sep = " ")

Arguments

x

The character vector we want to behave in a catty manner.

sep

The separator to output between elements of the catty vector.

Value

The catty vector.

Examples

x <- catty(letters)
x
y <- catty(month.name, sep="\n")
y


torfason/zulutils documentation built on Aug. 21, 2023, 5:46 p.m.