Add hyperlink to gt table groupname column in R

Viewed 34

I have the following table.
I would like the hyperlink in the groupname_col ("make") to render as a true hyperlink in the gt table. My code does not seem to be working.
Any advice very much appreciated.

library(tidyverse)
library(gt)

mtcars %>% 
          rownames_to_column("make") %>%
          head() %>%
          mutate(make = paste0("<a href = 'www.google.com'>",make, "</a>")) %>%
          mutate(make = ifelse(is.na(make), "", make), 
                 make = map(make, gt::html)) %>%
          gt(groupname_col= "make", 
             rownames_to_stub = TRUE) 
0 Answers
Related