Comment: Functions to manipulate cell comments.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Functions to manipulate cell comments.

Usage

1
2
3
4
5
createCellComment(cell, string="", author=NULL, visible=TRUE)

getCellComment(cell)

removeCellComment(cell)

Arguments

cell

a Cell object.

string

a string for the comment.

author

a string with the author's name

visible

a logical value. If TRUE the comment will be visible.

Details

These functions are not vectorized.

Value

createCellComment creates a Comment object.

getCellComment returns a the Comment object if it exists.

removeCellComment removes a comment from the given cell.

Author(s)

Adrian Dragulescu

See Also

For cells, see Cell. To format cells, see CellStyle.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  wb <- createWorkbook()
  sheet1 <- createSheet(wb, "Sheet1")
  rows   <- createRow(sheet1, rowIndex=1:10)     # 10 rows
  cells  <- createCell(rows, colIndex=1:8)       # 8 columns

  cell1 <- cells[[1,1]]
  setCellValue(cell1, 1)   # add value 1 to cell A1

  # create a cell comment
  createCellComment(cell1, "Cogito", author="Descartes")
  

  # extract the comments 
  comment <- getCellComment(cell1)
  stopifnot(comment$getAuthor()=="Descartes")
  stopifnot(comment$getString()$toString()=="Cogito")

  # don't forget to save your workbook!

colearendt/xlsx documentation built on Oct. 11, 2018, 12:23 a.m.