pillar
pillar copied to clipboard
Use of `focus` argument causes an error
This is because format_tbl()
no longer includes a focus
argument, but rather an input with a pillar_focus
attribute. This can result in upstream issues in tibble()
- see tibble issue #1351 for details.
I'd suggest either retaining a soft-deprecated focus
argument and using something like the following in format_tbl()
, or improving the error messages somehow (although the focus
argument was experimental to begin with).
#... From line 66
setup <- tbl_format_setup(x,
width = width, ...,
n = n,
max_extra_cols = max_extra_cols,
max_footer_lines = max_footer_lines,
# `%||%` allows a user to override the attribute value, meaning old code won't break
focus = focus %||% attr(x, "pillar_focus")
)
Reprex using only pillar:
tbl <- pillar:::new_tbl(list(a = 1))
print(tbl, focus = "a")
#> Error in tbl_format_setup(x, width = width, ..., n = n, max_extra_cols = max_extra_cols, : formal argument "focus" matched by multiple actual arguments
Created on 2022-08-28 by the reprex package (v2.0.1)
- [ ] Change
?tibble::formatting
, the ellipsis is never passed - [ ] Change documentation here
Needs https://github.com/r-lib/rlang/issues/1517 to fully clean up the docs and behavior.