The print method of a tibble permits the user to supply a value n to determine the number of rows to be printed. When supplying n = 1 to ... the argument is silently ignored and not propagated to the tibble print method. n = 6 is hard coded into the print method:
|
cat_line(format(as_tibble(dt, .name_repair = "minimal"), n = 6)[-1]) # Hack to remove "A tibble" line |
library(dtplyr)
print(lazy_dt(iris), n = 1)
#> Source: local data table [150 x 5]
#> Call: `_DT1`
#>
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> <dbl> <dbl> <dbl> <dbl> <fct>
#> 1 5.1 3.5 1.4 0.2 setosa
#> 2 4.9 3 1.4 0.2 setosa
#> 3 4.7 3.2 1.3 0.2 setosa
#> 4 4.6 3.1 1.5 0.2 setosa
#> 5 5 3.6 1.4 0.2 setosa
#> 6 5.4 3.9 1.7 0.4 setosa
#> # ℹ 144 more rows
#>
#> # Use as.data.table()/as.data.frame()/as_tibble() to access results
Created on 2024-01-25 with reprex v2.0.2
The print method of a tibble permits the user to supply a value
nto determine the number of rows to be printed. When supplyingn = 1to...the argument is silently ignored and not propagated to the tibble print method.n = 6is hard coded into the print method:dtplyr/R/step.R
Line 196 in 6e923bb
Created on 2024-01-25 with reprex v2.0.2