Printing or viewing

Tibbles have some unique characteristics when printing and viewing them on a terminal, including the RStudio console window.

Load and print data

Below we load the and_vertebrates data from the lterdatasampler package (hyperlink includes install instructions) and view it.

#Load package
library("lterdatasampler")
#subsetted and_vertebrates tibble
tibble::as_tibble(lterdatasampler::and_vertebrates)[1:10,1:5]
# A tibble: 10 × 5
    year sitecode section reach  pass
   <dbl> <chr>    <chr>   <chr> <dbl>
 1  1987 MACKCC-L CC      L         1
 2  1987 MACKCC-L CC      L         1
 3  1987 MACKCC-L CC      L         1
 4  1987 MACKCC-L CC      L         1
 5  1987 MACKCC-L CC      L         1
 6  1987 MACKCC-L CC      L         1
 7  1987 MACKCC-L CC      L         1
 8  1987 MACKCC-L CC      L         1
 9  1987 MACKCC-L CC      L         1
10  1987 MACKCC-L CC      L         1

Information on the format of a tibble is within the Tibble structure section

Larger tibbles

When printing out a larger tibble only a part of the tibble will be displayed with info on the undisplayed data below the displayed data.

By default only 10 rows of a tibble will be displayed.

The number of displayed columns is dynamic. The maximum amount of columns will be displayed based on the width of the viewer and the width of the data in the columns.

The info shown below a tibble is:

  • The number of rows that are not displayed
  • The number, names, and classes of the variables/columns not displayed
tibble::as_tibble(lterdatasampler::and_vertebrates)
# A tibble: 32,209 × 16
    year sitecode section reach  pass unitnum unittype vert_index pitnumber
   <dbl> <chr>    <chr>   <chr> <dbl>   <dbl> <chr>         <dbl>     <dbl>
 1  1987 MACKCC-L CC      L         1       1 R                 1        NA
 2  1987 MACKCC-L CC      L         1       1 R                 2        NA
 3  1987 MACKCC-L CC      L         1       1 R                 3        NA
 4  1987 MACKCC-L CC      L         1       1 R                 4        NA
 5  1987 MACKCC-L CC      L         1       1 R                 5        NA
 6  1987 MACKCC-L CC      L         1       1 R                 6        NA
 7  1987 MACKCC-L CC      L         1       1 R                 7        NA
 8  1987 MACKCC-L CC      L         1       1 R                 8        NA
 9  1987 MACKCC-L CC      L         1       1 R                 9        NA
10  1987 MACKCC-L CC      L         1       1 R                10        NA
# ℹ 32,199 more rows
# ℹ 7 more variables: species <chr>, length_1_mm <dbl>, length_2_mm <dbl>,
#   weight_g <dbl>, clip <chr>, sampledate <date>, notes <chr>