print.factor
Use print on a factor Object

Description

This is an S3 method for the function print for objects inheriting from class factor.

Usage

print(x, ...)

Arguments

x a factor object.
... additional arguments.
Examples
f <- factor(c())
print(f)
# factor(0)
# Levels: 

f <- factor(c("a", "b", "c")) print(f) # [1] a b c # Levels: a b c

f <- factor(c("a", "b", "c"), ordered=TRUE) print(f) # [1] a b c # Levels: a < b < c

f <- factor(c("a", "b", "c")) print(f, quote=TRUE) # [1] "a" "b" "c" # Levels: "a" "b" "c"

f <- factor(c("a", "b", "c")) print(f, max.levels=2) # [1] a b c # 3 Levels: a ... c

Package base version 6.1.4-13
Package Index