| print {base} | R Documentation |
Print Values
Description
print prints its argument and returns it invisibly (via
invisible(x)). It is a generic function which means that
new printing methods can be easily added for new
classes.
Usage
print(x, ...)
print.factor(x, quote = FALSE, max.levels = NULL,
width = getOption("width"), ...)
Arguments
x |
an object used to select a method. |
... |
further arguments passed to or from other methods. |
quote |
logical, indicating whether or not strings should be printed with surrounding quotes. |
max.levels |
integer, indicating how many levels should be
printed for a factor; if |
width |
only used when |
Details
The default method, print.default has its own help page.
Use methods("print") to get all the methods for the
print generic.
print.factor allows some customization and is used for printing
ordered factors as well.
See noquote as an example of a class whose main
purpose is a specific print method.
References
Chambers, J. M. and Hastie, T. J. (1992) Statistical Models in S. Wadsworth \& Brooks/Cole.
See Also
The default method print.default, and help for the
methods above; further options, noquote.
For more customizable (but cumbersome) printing, see
cat, format or also write.
Examples
ts(1:20)#-- print is the ``Default function'' --> print.ts(.) is called
rr <- for(i in 1:3) print(1:i)
rr
## Printing of factors illustrated for ex