Print Data

DESCRIPTION:

Prints the input.

USAGE:

print.default(x, digits=options()$digits, quote=T, prefix="")

REQUIRED ARGUMENTS:

x
any object. Missing values ( NAs) are allowed.

OPTIONAL ARGUMENTS:

digits
the number of significant digits that should be printed in numeric or complex data. Since all numbers in any vector are printed in the same format, this may mean that some numbers will be printed with more than 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.
quote
logical flag: if TRUE, character strings are printed with surrounding quotes.
prefix
a character string used only by the 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.

VALUE:

x, with the invisible flag set to prevent reprinting.

SIDE EFFECTS:

object x is printed in an appropriate format.

DETAILS:

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.

SEE ALSO:

, , , , , , , , , .

EXAMPLES:

# 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)