0

The tibble package at version 1.4.2 has options which are listed in the documentation under tibble-options. For example, one such option is tibble.max_extra_cols which defaults to 100.

How does one access and set these options?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
peter2108
  • 5,580
  • 6
  • 24
  • 18

1 Answers1

4

Use options to set and getOption to retrieve. For example, below we set "tibble.print_min" to 3; then we show that we did indeed set it and display the 150 row iris dataset as a tibble noting that only 3 rows display. Finally we set "tibble.print_min" back to its default noting that if getOption("tibble.print_min") returns NULL it means that the default will be used. Now 10 rows are displayed.

library(tibble)

options(tibble.print_min = 3)
getOption("tibble.print_min")
## [1] 3

as.tibble(iris)
## # A tibble: 150 x 5
##   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
##          <dbl>       <dbl>        <dbl>       <dbl> <fct>  
## 1         5.10        3.50         1.40       0.200 setosa 
## 2         4.90        3.00         1.40       0.200 setosa 
## 3         4.70        3.20         1.30       0.200 setosa 
## # ... with 147 more rows

options(tibble.print_min = NULL)
getOption("tibble.print_min")
## [1] NULL

as.tibble(iris)
## # A tibble: 150 x 5
##    Sepal.Length Sepal.Width Petal.Length Petal.Width Species
##           <dbl>       <dbl>        <dbl>       <dbl> <fct>  
##  1         5.10        3.50         1.40       0.200 setosa 
##  2         4.90        3.00         1.40       0.200 setosa 
##  3         4.70        3.20         1.30       0.200 setosa 
##  4         4.60        3.10         1.50       0.200 setosa 
##  5         5.00        3.60         1.40       0.200 setosa 
##  6         5.40        3.90         1.70       0.400 setosa 
##  7         4.60        3.40         1.40       0.300 setosa 
##  8         5.00        3.40         1.50       0.200 setosa 
##  9         4.40        2.90         1.40       0.200 setosa 
## 10         4.90        3.10         1.50       0.100 setosa 
## # ... with 140 more rows
G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341