[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  print.default: Default Printing

##  Description

` print.default ` is the _default_ method of the generic ` [ print
](/link/print?package=base&version=3.6.2) ` function which prints its
argument.

##  Usage

    
    
    # S3 method for default
    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 ` digits ` specifies the minimum number of significant
digits to be printed in values. The default, ` NULL ` , uses ` [ getOption
](/link/getOption?package=base&version=3.6.2) ("digits") ` . (For the
interpretation for complex numbers see ` [ signif
](/link/signif?package=base&version=3.6.2) ` .) Non-integer values will be
rounded down, and only values greater than or equal to 1 and no greater than
22 are accepted.

quote

logical, indicating whether or not strings ( ` [ character
](/link/character?package=base&version=3.6.2) ` s) should be printed with
surrounding quotes.

na.print

a character string which is used to indicate ` [ NA
](/link/NA?package=base&version=3.6.2) ` values in printed output, or ` NULL `
(see ‘Details’).

print.gap

a non-negative integer \\(\le 1024\\), or ` NULL ` (meaning 1), giving the
spacing between adjacent columns in printed vectors, matrices and arrays.

right

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

max

a non-null value for ` max ` specifies the approximate maximum number of
entries to be printed. The default, ` NULL ` , uses ` [ getOption
](/link/getOption?package=base&version=3.6.2) ("max.print") ` ; see that help
page for more details.

useSource

logical, indicating whether to use source references or copies rather than
deparsing [ language objects
](/link/language%20objects?package=base&version=3.6.2) . 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.

##  Large number of digits

Note that for large values of ` 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.

##  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
](/link/Quotes?package=base&version=3.6.2) ), 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. (Because some versions of Windows get this
wrong, all bytes with the upper bit set are regarded as printable on Windows
in a single-byte locale.)

##  Unicode and other multi-byte locales

In all locales, the characters in the ASCII range (  0x00  to  0x7f  ) are
printed in the same way, as-is if printable, otherwise via ANSI escape
sequences or 3-digit octal escapes as described for single-byte locales.

Multi-byte non-printing characters are printed as an escape sequence of the
form  \uxxxx  or  \Uxxxxxxxx  (in hexadecimal). This is the internal code for
the wide-character representation of the character. If this is not known to be
Unicode code points, a warning is issued. The only known exceptions are
certain Japanese ISO 2022 locales on commercial Unixes, which use a
concatenation of the bytes: it is unlikely that  R  compiles on such a system.

It is possible to have a character string in a character vector that is not
valid in the current locale. If a byte is encountered that is