print.default(x, digits=options()$digits, quote=T, prefix="")
NA
s) are allowed.
digits
significant digits.
Use
digits=17
to print all
of the significant digits of a double precision number.
If the argument is omitted,
the
digits
option is used;
see
options
.
TRUE
,
character strings are printed with surrounding quotes.
print.list
and
print.structure
methods.
In both cases, the principal use of
prefix
is to identify the data set from which the components (for lists)
or attributes (for structures) are extracted.
x
,
with the invisible flag set to prevent reprinting.
x
is printed in an appropriate format.
The
print
function is generic --
it uses the class of the object to determine the method to use.
The
print.default
method,
used when
x
doesn't have
a
class
attribute,
calls various functions like
print.ts
,
print.list
and
print.matrix
depending on what
x
is.
Multivariate time series are printed
(via
print.structure
) like a matrix;
followed by the
"tsp"
attribute.
In contrast,
print.ts
prints
each univariate series in turn.
The standard S-PLUS session calls
print
to print
results of function calls,
unless the invisible flag has been set
(see
invisible
).
The options
width
and
length
control line width and page length.
When printing a vector a new format may be chosen for each page.
When printing matrices, the column labels are repeated once per page.
The arguments
digits
,
quotes
,
and
prefix
are used
only with specific data structures.
They may have no effect when used with arbitrary data structures
of a specific class,
unless a class-specific print method is defined.
# In a loop, explicit printing is necessary: for(i in 1:10) print(i) # Compare this with: for(i in 1:10) i round(x, 3) # auto print of x rounded to 3 decimal places print(x, 3) # x to 3-significant digits attr(iris, doc) <- "Fisher's Iris Data" print(iris, prefix=iris) # compare this with print(iris)