| print.default {base} | R Documentation |
Default Printing
Description
print.default is the default method of the generic
print function which prints its argument.
Usage
## Default S3 method:
print(x, digits = NULL, quote = TRUE, na.print = NULL,
print.gap = NULL, right = FALSE, max = NULL, useSource = TRUE, ...)
Arguments
x |
the object to be printed. |
digits |
a non-null value for |
quote |
logical, indicating whether or not strings
( |
na.print |
a character string which is used to indicate
|
print.gap |
a non-negative integer |
right |
logical, indicating whether or not strings should be right aligned. The default is left alignment. |
max |
a non-null value for |
useSource |
logical, indicating whether to use source references or copies rather than deparsing language objects. The default is to use the original source if it is available. |
... |
further arguments to be passed to or from other methods. They are ignored in this function. |
Details
The default for printing NAs is to print NA (without
quotes) unless this is a character NA and quote =
FALSE, when <NA> is printed.
The same number of decimal places is used throughout a vector. This
means that digits specifies the minimum number of significant
digits to be used, and that at least one entry will be encoded with
that minimum number. However, if all the encoded elements then have
trailing zeroes, the number of decimal places is reduced until at
least one element has a non-zero final digit. Decimal points are only
included if at least one decimal place is selected.
Attributes are printed respecting their class(es), using the values of
digits to print.default, but using the default values
(for the methods called) of the other arguments.
When the methods package is attached, print will call
show for R objects with formal classes if called
with no optional arguments.
Warning
Using too large a value of digits may lead to representation
errors in the calculation of the number of significant digits and the
decimal representation: these are likely for digits >= 16, and
as from R 2.5.0 these possible errors are taken into account in
assessing the numher of significant digits to be printed in that case.
Whereas earlier versions of R might have printed further digits for
digits >= 16 on some platforms, they were not necessarily reliable.
Single-byte locales
If a non-printable character is encountered during output, it is
represented as one of the ANSI escape sequences (\a, \b,
\f, \n, \r, \t, \v, \\ and
\0: see Quotes), or failing that as a 3-digit octal
code: for example the UK currency pound sign in the C locale (if
implemented correctly) is printed as \243. Which characters
are non-printable depends on the locale.