print.defaultis the default method of the generic
# S3 method for default print(x, digits = NULL, quote = TRUE, na.print = NULL, print.gap = NULL, right = FALSE, max = NULL, useSource = TRUE, …)
digitsspecifies the minimum number of significant digits to be printed in values. The default,
getOption("digits"). (For the interpretation for complex numbers see
signif.) Non-integer values will be rounded down, and only values greater than or equal to 1 and no greater than 22 are accepted.
characters) should be printed with surrounding quotes.
NAvalues in printed output, or
NULL(meaning 1), giving the spacing between adjacent columns in printed vectors, matrices and arrays.
maxspecifies the approximate maximum number of entries to be printed. The default,
getOption("max.print"); see that help page for more details.
digits, currently for
digits >= 16, the calculation of the number of significant digits will depend on the platform's internal (C library) implementation of sprintf() functionality.
NAs is to print
NA(without quotes) unless this is a character
quote = FALSE, when <NA> is printed. The same number of decimal places is used throughout a vector. This means that
digitsspecifies 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
print.default, but using the default values (for the methods called) of the other arguments. Option
widthcontrols the printing of vectors, matrices and arrays, and option
deparse.cutoffcontrols the printing of language objects such as calls and formulae. When the methods package is attached,
showfor R objects with formal classes if called with no optional arguments.
"noquote"class and print method.
encodeString, which encodes a character vector the way it would be printed.
pi print(pi, digits = 16) LETTERS[1:16] print(LETTERS, quote = FALSE) M <- cbind(I = 1, matrix(1:10000, ncol = 10, dimnames = list(NULL, LETTERS[1:10]))) utils::head(M) # makes more sense than print(M, max = 1000) # prints 90 rows and a message about omitting 910
Run the code above in your browser using DataCamp Workspace