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)
| use | Logical. Use tibble for printing or not? Default uses |
|---|
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.
# 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)#>a#> Species n #> 1: setosa 50 #> 2: versicolor 50 #> 3: virginica 50class(a)#> [1] "data.table" "data.frame"print.data.table = show_tibble(FALSE)#>a#> Species n #> 1: setosa 50 #> 2: versicolor 50 #> 3: virginica 50class(a)#> [1] "data.table" "data.frame"