Description Usage Arguments Details Value Author(s) Examples
Create and set cell styles.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | CellStyle(
wb,
dataFormat = NULL,
alignment = NULL,
border = NULL,
fill = NULL,
font = NULL,
cellProtection = NULL
)
is.CellStyle(x)
## Default S3 method:
CellStyle(
wb,
dataFormat = NULL,
alignment = NULL,
border = NULL,
fill = NULL,
font = NULL,
cellProtection = NULL
)
setCellStyle(cell, cellStyle)
getCellStyle(cell)
|
wb |
a workbook object as returned by |
dataFormat |
a |
alignment |
a |
border |
a |
fill |
a |
font |
a |
cellProtection |
a |
x |
a |
cell |
a |
cellStyle |
a |
setCellStyle
sets the CellStyle
to one Cell
object.
You need to have a Workbook
object to attach a CellStyle
object to it.
Since OS X 10.5 Apple dropped support for AWT on the main thread, so essentially you cannot use any graphics classes in R on OS X 10.5 since R is single-threaded. (verbatim from Simon Urbanek). This implies that setting colors on Mac will not work as is! A set of about 50 basic colors are still available please see the javadocs.
For Excel 95/2000/XP/2003 the choice of colors is limited. See
INDEXED_COLORS_
for the list of available colors.
Unspecified values for arguments are taken from the system locale.
createCellStyle
creates a CellStyle object.
is.CellStyle
returns TRUE
if the argument is of class
"CellStyle" and FALSE
otherwise.
Adrian Dragulescu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
wb <- createWorkbook()
sheet <- createSheet(wb, "Sheet1")
rows <- createRow(sheet, rowIndex=1)
cell.1 <- createCell(rows, colIndex=1)[[1,1]]
setCellValue(cell.1, "Hello R!")
cs <- CellStyle(wb) +
Font(wb, heightInPoints=20, isBold=TRUE, isItalic=TRUE,
name="Courier New", color="orange") +
Fill(backgroundColor="lavender", foregroundColor="lavender",
pattern="SOLID_FOREGROUND") +
Alignment(h="ALIGN_RIGHT")
setCellStyle(cell.1, cellStyle1)
# you need to save the workbook now if you want to see this art
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.