Description Usage Arguments Author(s) References Examples
Add a paragraph of text to a worksheet
1 2 3 | xlsx.addParagraph(wb, sheet, value, fontColor = "#FFFFFF", fontSize = 12,
backGroundColor = "#FFFFFF", isBold = FALSE, isItalic = FALSE,
startRow = NULL, startCol = 2, colSpan = 10, rowSpan = 5)
|
wb |
workbook object |
sheet |
sheet object |
value |
text to write |
fontColor |
color of the text |
fontSize |
size of the text |
backGroundColor |
background color of the text container |
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 |
colSpan |
number of columns to be merged (paragraph : width) |
rowSpan |
number of rows to be merged (paragraph height) |
Alboukadel Kassambara <alboukadel.kassambara@gmail.com>
http://www.sthda.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # create an Excel workbook. Both .xls and .xlsx file formats can be used.
wb <- createWorkbook(type="xlsx")
# Create a sheet in that workbook
sheet <- createSheet(wb, sheetName = "example1")
# Add paragraph
xlsx.addHeader(wb, sheet, " Add paragraph", level=2, underline=1)
xlsx.addLineBreak(sheet, 2)
paragraph="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged."
xlsx.addParagraph(wb, sheet, paragraph, fontSize=14, isItalic=TRUE,
fontColor="darkred", backGroundColor="gray",
colSpan=10, rowSpan=10)
# saving a workbook to an Excel file and write the file to the disk.
saveWorkbook(wb, "examples_add_paragraph.xlsx")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.