ID EN
I/O & Files

print.default

R Base 3.6.2 🇮🇩 Bahasa Indonesia

print.default adalah metode default dari fungsi print generik yang mencetak argumennya.

Syntax

R
# S3 method for default
print(x, digits = NULL, quote = TRUE,
      na.print = NULL, print.gap = NULL, right = FALSE,
      max = NULL, useSource = TRUE, …)

Arguments

Parameter Deskripsi
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("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.
quote logical, indicating whether or not strings (characters) 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 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("max.print"); see that help page for more details.
useSource logical, indicating whether to use source references or copies rather than deparsing language objects. 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.

Details

Default untuk mencetak NA adalah mencetak NA (tanpa tanda kutip) kecuali ini adalah karakter NA dan kutipan = FALSE, ketika <NA> dicetak. Jumlah tempat desimal yang sama digunakan di seluruh vektor. Artinya digit menentukan jumlah minimum digit penting yang akan digunakan, dan setidaknya satu entri akan dikodekan dengan nomor minimum tersebut. Namun, jika semua elemen yang dikodekan kemudian memiliki angka nol di belakangnya, jumlah tempat desimal dikurangi hingga setidaknya satu elemen memiliki digit akhir bukan nol. Poin desimal hanya disertakan jika setidaknya satu tempat desimal dipilih. Atribut dicetak berdasarkan kelasnya, menggunakan nilai digit untuk print.default, tetapi menggunakan nilai default (untuk metode yang dipanggil) dari argumen lainnya. Lebar opsi mengontrol pencetakan ve

Contoh

Example
R
# NOT RUN {
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
# }

See Also

The generic print options. The "noquote" class and print method. encodeString which encodes a character vector the way it would be printed.