This function prints a (possibly abbreviated) data.frame.
Usage
print_data.frame(
x,
rows = NULL,
cols = NULL,
digits = NULL,
row.names = TRUE,
col.names = TRUE
)Arguments
- x
[
data.frame]
Adata.frame.- rows, cols
[
integer(1)|NULL]
The number of rows or columns to be printed, greater or equal2.Printing is abbreviated in the middle.
Can be
NULLto print everything.- digits
[
integer(1)|NULL]
The number of decimal places to be used.Negative values are allowed, resulting in rounding to a power of ten.
Can be
NULLto not round.- row.names, col.names
[
logical(1)]
Print row names or column names?
See also
Other package helpers:
Dictionary,
Storage,
check_missing(),
find_namespace_calls(),
identical_structure(),
input_check_response(),
match_arg(),
package_logo(),
print_matrix(),
system_information(),
unexpected_error(),
user_confirm()
Examples
x <- data.frame(1:10, LETTERS[1:10], stats::rnorm(10))
print_data.frame(x, rows = 7)
#> X1.10 LETTERS.1.10. stats..rnorm.10.
#> 1 1 A -2.1574594
#> 2 2 B -0.5628703
#> 3 3 C -0.3521802
#> 4 4 D 0.1016748
#>
#> <3 rows hidden>
#>
#> 8 8 H -0.7490392
#> 9 9 I -0.5092430
#> 10 10 J 0.4392961
print_data.frame(x, rows = 7, cols = 2)
#> X1.10 <1 col hidden> stats..rnorm.10.
#> 1 1 - -2.1574594
#> 2 2 - -0.5628703
#> 3 3 - -0.3521802
#> 4 4 - 0.1016748
#>
#> <3 rows hidden>
#>
#> 8 8 - -0.7490392
#> 9 9 - -0.5092430
#> 10 10 - 0.4392961
print_data.frame(x, rows = 7, cols = 2, digits = 1)
#> X1.10 <1 col hidden> stats..rnorm.10.
#> 1 1 - -2.2
#> 2 2 - -0.6
#> 3 3 - -0.4
#> 4 4 - 0.1
#>
#> <3 rows hidden>
#>
#> 8 8 - -0.7
#> 9 9 - -0.5
#> 10 10 - 0.4
print_data.frame(x, rows = 7, cols = 2, digits = 1, row.names = FALSE)
#> X1.10 <1 col hidden> stats..rnorm.10.
#> 1 - -2.2
#> 2 - -0.6
#> 3 - -0.4
#> 4 - 0.1
#>
#> <3 rows hidden>
#>
#> 8 - -0.7
#> 9 - -0.5
#> 10 - 0.4
print_data.frame(x, rows = 7, cols = 2, digits = 1, col.names = FALSE)
#> <1 col hidden>
#> 1 1 - -2.2
#> 2 2 - -0.6
#> 3 3 - -0.4
#> 4 4 - 0.1
#>
#> <3 rows hidden>
#>
#> 8 8 - -0.7
#> 9 9 - -0.5
#> 10 10 - 0.4
