make_hyperlink: Create a hyperlink to display as a link on a tableHTML

View source: R/make_hyperlink.R

make_hyperlinkR Documentation

Create a hyperlink to display as a link on a tableHTML

Description

make_hyperlink add the relevant <a> tag on a vector.

Usage

make_hyperlink(vec, message = NULL)

Arguments

vec

A vector. Typically the column of a data.frame.

message

The hyperlinks name. If it is omitted, the actual link will be used as the name

Details

make_hyperlink The standard way to use this (although it can be used outside a tableHTML) is to convert a column with plain URLs into clickable hyperlinks when you render the HTML table. **Make sure the escape argument of tableHTML is set to FALSE for this to work as expected.**

Value

A character vector which will represent an HTML hyperlink

Examples

#make sure the escape argument is set to FALSE for this to work
tableHTML(data.frame(mpg = make_hyperlink(mtcars$mpg)), escape = FALSE)

tableHTML(data.frame(mpg = make_hyperlink(mtcars$mpg, 1:32)), escape = FALSE)


LyzandeR/tableHTML documentation built on April 17, 2023, 3:57 p.m.