Skip to content

cols_hide() has a documentation issue and error msg #1631

Closed

Description

@olivroy

Description

library(gt)

exibble |> 
  gt() |> 
  cols_hide()
#> Error in translate_legacy_resolver_expr(quo, null_means): l'argument "expr" est manquant, avec aucune valeur par défaut

Created on 2024-04-24 with reprex v2.1.0

The message when you forget to supply input to cols_hide() is a bit ugly and the docs is misleading.

Docs are this currently

Columns to target

⁠<column-targeting expression>⁠ // default: everything()

Expected result

I think that the documentation should be updated and say that columns must be supplied.

I also think it would be better to use rlang::check_required() in cols_hide() to avoid an ugly message.

I don't think having the documented everything() as a default is a good idea. (documentation was not updated when #1342 was resolved)

I think the implentation of the function is (almost) okay.

Activity

  1. changed the title [-]`cols_hide()` has a documentation isseu[/-] [+]`cols_hide()` has a documentation issue and error msg[/+] on Apr 24, 2024
  2. moved this from Backlog to To discuss / To plan in R Markdown Team Projectson Apr 24, 2024
  3. added this to the v0.10.2 milestone on Apr 24, 2024
  4. olivroy commented on Apr 24, 2024

    @olivroy
    CollaboratorAuthor

    Preparing a PR, but the edge case gives a bad message. (not affected by the PR)

     gt(exibble) |> cols_hide(c(everything()))
    

    would be good if it behaved like

    gt(data.frame())

    This worked properly in gt 0.10.0, but stopped working in gt 0.10.1....

    # blank in gt 0.10.0
    exibble |> gt() |> cols_hide(everything())
    # errors in gt 0.10.1
    #> Error in has_rtl[i, ] : subscript out of bounds
    
  5. moved this from To discuss / To plan to Done in R Markdown Team Projectson Apr 24, 2024
  6. modified the milestones: v0.10.2, v0.11.0 on Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions