We're already obeying getOption("max.print") via print(format(x)), but we're still calling format() on the full vctr. We could do a better job by providing the necessary infrastructure in obj_print() and passing max to obj_print_footer() .
I'll experiment with pillar::num() and pillar::char() .
print(vctrs::new_vctr(letters), max = 10)
#> <vctrs_vctr[26]>
#> [1] a b c d e f g h i j k l m n o p q r s t u v w x y z
options(max.print = 5)
print(vctrs::new_vctr(letters))
#> <vctrs_vctr[26]>
#> [1] a b c d e
#> [ reached getOption("max.print") -- omitted 21 entries ]
print(letters, max = 10)
#> [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"
#> [ reached getOption("max.print") -- omitted 16 entries ]
print(letters)
#> [1] "a" "b" "c" "d" "e"
#> [ reached getOption("max.print") -- omitted 21 entries ]
We're already obeying
getOption("max.print")
viaprint(format(x))
, but we're still callingformat()
on the full vctr. We could do a better job by providing the necessary infrastructure inobj_print()
and passingmax
toobj_print_footer()
.I'll experiment with
pillar::num()
andpillar::char()
.Created on 2021-04-08 by the reprex package (v1.0.0)