Skip to content

Two text_replace() subsequent calls with cells_column_labels() gives weird result #1824

@olivroy

Description

@olivroy

Prework

Description

exibble |> 
  gt() |> 
  text_replace(
    "u",
    "xx",
    locations = cells_column_labels()
  ) |> 
  text_replace(
    "ux",
    "xx",
    locations = cells_column_labels()
  )
add047ce-ed65-479f-9e6d-69150d942dc8

For now, I am okay with using the workaround with text_case_match().

exibble |> 
  gt() |> 
  text_case_match(
    .replace = "partial",
   .locations = cells_column_labels(),
    "u" ~   "xx",
    "ux" ~ "xx",
  )

Reproducible example

  • Post a minimal reproducible example so the maintainer can troubleshoot the problems you identify. A reproducible example is:
    • Runnable: post enough R code and data so any onlooker can create the error on their own computer.
    • Minimal: reduce runtime wherever possible and remove complicated details that are irrelevant to the issue at hand.
    • Readable: format your code according to the tidyverse style guide.

Expected result

No list() shown on the column labels.

Session info

gt 0.11.0.9000 (reproducible in gt 0.10.1 also)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions