Declares a clear action that blanks the display text of specified cells in
rows matching the parent compute_cols() condition. The cells are rendered
empty without affecting their column structure, width, or styling.
Value
Quosure-style marker (internal use within compute_cols())
Details
Must be called inside compute_cols().
Behavior:
Sets the RENDERED cell text to
""for matching rows. The clear is display-only: conditions incompute_cols()keep seeing the RAW data values, and the column still participates in width/format resolution.Actions execute in ARRIVAL order (argument order within the call, then pipe order across calls) — clear is not automatically "first". Placing
c_clear()beforec_glue()on the same column turns the pair into a full REPLACEMENT (glue lands on the emptied cell); placingc_glue()beforec_clear()wipes the cell afterwards.Compatible with
c_style(): styling is independent of text content.When
c_merge()spans a cleared leader cell, the merged span renders as a blank merged cell.
Examples
spec <- create_table(mtcars)
# Blank the disp column for four-cylinder rows
spec <- compute_cols(spec, cyl == 4, c_clear(disp))
# Clear then re-fill from another column (full replacement:
# canonical merge -> clear -> glue ordering inside ONE call)
spec2 <- create_table(mtcars) |>
compute_cols(hp == 62,
c_clear(carb),
c_glue(carb, "after", text = "-"))