Use a portion of the metro dataset to create a gt table. We’ll use text_case_when() to supply pairs of predicate statements and replacement text. For the connect_rer column, we will perform a count of pattern matches with stringr::str_count() and determine which cells have 1, 2, or 3 matched patterns. For each of these cases, descriptive replacement text is provided. Here, we use a .default value to replace the non-matched cases with an empty string (""). Finally, we use cols_label() to modify the labels of the three columns.