Use sp500 to create a gt table. Transform the text in the date column using a function supplied to text_transform() (via the fn argument). Note that the x in the fn = function (x) part consists entirely of ISO 8601 date strings (which are acceptable as input to the vec_fmt_date() and vec_fmt_datetime() functions).
Use gtcars to create a gt table. First, the numeric values in the n column are formatted as spelled-out numbers with fmt_spelled_num(). The output values are indeed spelled out but exclusively with lowercase letters. We actually want these words to begin with a capital letter and end with a period. To make this possible, the text_transform() function will be used since it can modify already-formatted text. Through the fn argument, we provide a custom function that uses R’s toTitleCase() operating on x (the numbers-as-text strings) within a paste0() so that a period can be properly placed.