Skip to contents

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
#> a b c d e f g h i j k l m n o p q r s t u v w x y z
y <- catty(month.name, sep="\n")
y
#> January
#> February
#> March
#> April
#> May
#> June
#> July
#> August
#> September
#> October
#> November
#> December