This function could let the user to choose whether they would like the output data.table to be printed as the form of data.table or tibble.

show_tibble(use = FALSE)

Arguments

use

Logical. Use tibble for printing or not? Default uses FALSE.

Details

This function actually define or remove a function named as print.data.table which let it return the printing of the tibble. One can also turn off this mode by rm(print.data.table). Note that this procedure would not change the form of data.table, but just change the printing output.

Examples

# while the printing form changes, the class of data never changes iris %>% count_dt(Species) -> a class(a)
#> [1] "data.table" "data.frame"
print.data.table = show_tibble(TRUE)
#> The tibble mode has been turned on.
a
#> Species n #> 1: setosa 50 #> 2: versicolor 50 #> 3: virginica 50
#> [1] "data.table" "data.frame"
print.data.table = show_tibble(FALSE)
#> The tibble mode has been shut off.
a
#> Species n #> 1: setosa 50 #> 2: versicolor 50 #> 3: virginica 50
#> [1] "data.table" "data.frame"