flextable (version 0.5.5)

hyperlink_text: chunk of text with hyperlink wrapper

Description

The function lets add hyperlinks within flextable objects with function compose. It should be used inside a call to as_paragraph.

Usage

hyperlink_text(x, props = NULL, formater = format_fun, url, ...)

Arguments

x

text or any element that can be formatted as text with function provided in argument formater.

props

an fp_text object to be used to format the text. If not specified, it will be the default value corresponding to the cell.

formater

a function that will format x as a character vector.

url

url to be used

...

additional arguments for formater function.

See Also

display

Other chunk elements for paragraph: as_bracket, as_b, as_chunk, as_image, as_i, as_sub, as_sup, linerange, minibar

Examples

Run this code
# NOT RUN {
dat <- data.frame(
  col = "Google it",
  href = "https://www.google.fr/search?source=hp&q=flextable+R+package",
  stringsAsFactors = FALSE)

ft <- flextable(dat)
ft <- compose( x = ft, j = "col",
  value = as_paragraph(
    "This is a link: ",
    hyperlink_text(x = col, url = href ) ) )
ft
# }

Run the code above in your browser using DataCamp Workspace