Skip to contents

The colDef_urlLink function generates column definitions for hyperlinked URLs in a Reactable table. It creates column definitions based on provided column names and a text to display as the link.

Usage

colDef_urlLink(cols, link_text)

Arguments

cols

A character vector specifying the column names for which the hyperlink column definitions are to be generated.

link_text

A character string specifying the text to be displayed as the link.

Value

A list of column definitions suitable for use in a Reactable table.

Examples


mtcars %>%
  mutate(url_raw = "www.google.com",
         url_names = rownames(.)) %>%
  remove_rownames() %>%
  reactable(
    defaultColDef = colDef(footerStyle = list(fontWeight = "bold")),
    columns = combined_named_lists(
      colDef_urlLink(cols = "url_raw", link_text = "Example text to link")
    )
  )
#> Error in map(item_list, names): could not find function "map"