
Last chance! 50% off unlimited learning
Sale ends in
The function lets add hyperlinks within flextable
objects with function compose
.
It should be used inside a call to as_paragraph
.
hyperlink_text(x, props = NULL, formatter = format_fun, url, ...)
text or any element that can be formatted as text
with function provided in argument formatter
.
an fp_text
object to be used to format the text.
If not specified, it will be the default value corresponding to the cell.
a function that will format x as a character vector.
url to be used
additional arguments for formatter
function.
Other chunk elements for paragraph:
as_bracket()
,
as_b()
,
as_chunk()
,
as_image()
,
as_i()
,
as_sub()
,
as_sup()
,
linerange()
,
lollipop()
,
minibar()
# NOT RUN {
dat <- data.frame(
col = "Google it",
href = "https://www.google.fr/search?source=hp&q=flextable+R+package",
stringsAsFactors = FALSE)
ftab <- flextable(dat)
ftab <- compose( x = ftab, j = "col",
value = as_paragraph(
"This is a link: ",
hyperlink_text(x = col, url = href ) ) )
ftab
# }
Run the code above in your browser using DataLab