Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of focus argument causes an error #585

Open
wurli opened this issue Aug 23, 2022 · 2 comments · May be fixed by #637
Open

Use of focus argument causes an error #585

wurli opened this issue Aug 23, 2022 · 2 comments · May be fixed by #637
Labels

Comments

@wurli
Copy link

wurli commented Aug 23, 2022

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")
  )
@krlmlr
Copy link
Member

krlmlr commented Aug 28, 2022

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)

@krlmlr krlmlr added the bug label Sep 11, 2022
@krlmlr
Copy link
Member

krlmlr commented Oct 30, 2022

  • Change ?tibble::formatting, the ellipsis is never passed
  • Change documentation here

Needs r-lib/rlang#1517 to fully clean up the docs and behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants