print.default              package:base              R Documentation

Default Printing

Description:

     'print.default' is the _default_ method of the generic 'print'
     function which prints its argument. 'print.matrix' is currently
     identical, but was not prior to '1.7.0'.

Usage:

     ## Default S3 method:
     print(x, digits = NULL, quote = TRUE, na.print = NULL,
           print.gap = NULL, right = FALSE, ...)

Arguments:

       x: the object to be printed.

  digits: a non-null value for 'digits' specifies the minimum number of
          significant digits to be printed in values.  If 'digits' is
          'NULL', the value of 'digits' set by 'options' is used.

   quote: logical, indicating whether or not strings ('character's)
          should be printed with surrounding quotes.

na.print: a character string which is used to indicate 'NA' values in
          printed output, or 'NULL' (see Details)

print.gap: an integer, giving the spacing between adjacent columns in
          printed matrices and arrays, or 'NULL' meaning 1.

   right: logical, indicating whether or not strings should be
          right-aligned. The default is left-alignment.

     ...: further arguments to be passed to or from other methods. They
          are ignored in these functions.

Details:

     Prior to R 1.7.0, 'print.matrix' did not print attributes and did
     not have a 'digits' argument.

     The default for printing 'NA's 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
     printed with that minimum number.

     As from R 1.7.0 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 methods with formal classes if called with no optional
     arguments.

See Also:

     The generic 'print', 'options'. The '"noquote"' class and print
     method.

Examples:

     pi
     print(pi, digits = 16)
     LETTERS[1:16]
     print(LETTERS, quote = FALSE)

