xlsx.addHyperlink: Add a hyperlink to a worksheet.

Description Usage Arguments Author(s) References Examples

View source: R/r2excel.r

Description

Add a hyperlink to a worksheet.

Usage

1
2
3
4
xlsx.addHyperlink(wb, sheet, address, friendlyName,
                  fontColor = "blue", fontSize = 12, 
                  isBold = FALSE, isItalic = FALSE,
                  startRow = NULL, startCol = 2)

Arguments

wb

workbook object

sheet

sheet object

address

text indicating the url

friendlyName

text specifying the name of the link

fontColor

the color to use for the text of the link

fontSize

the font size of the text

isBold

if TRUE, the text is written in bold format

isItalic

if TRUE, the text is written in italic format

startRow

a numeric value specifying the starting row

startCol

a numeric value specifying the starting column

Author(s)

Alboukadel Kassambara <alboukadel.kassambara@gmail.com>

References

http://www.sthda.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# create an Excel workbook. Both .xls and .xlsx file formats can be used.
wb <- createWorkbook(type="xlsx")
# Create a sheet in that workbook
sheet <- xlsx::createSheet(wb, sheetName = "example1")
 
# Add Hyperlink
#+++++++++++++++++++++++++++++
xlsx.addHeader(wb, sheet, " Add Hyperlink", level=2, underline=1)
xlsx.addLineBreak(sheet, 1)
xlsx.addHyperlink(wb, sheet, "http://www.sthda.com", "Click-me!", fontSize=12)
xlsx.addLineBreak(sheet, 2)

# saving a workbook to an Excel file and write the file to the disk.
saveWorkbook(wb, "examples_add_hyperlink.xlsx")

kassambara/r2excel documentation built on May 20, 2019, 7:40 a.m.