File: writeComment.Rd

package info (click to toggle)
r-cran-openxlsx 4.2.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,328 kB
  • sloc: cpp: 1,867; makefile: 2
file content (47 lines) | stat: -rw-r--r-- 1,263 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CommentClass.R
\name{writeComment}
\alias{writeComment}
\title{write a cell comment}
\usage{
writeComment(wb, sheet, col, row, comment, xy = NULL)
}
\arguments{
\item{wb}{A workbook object}

\item{sheet}{A vector of names or indices of worksheets}

\item{col}{Column a column number of letter}

\item{row}{A row number.}

\item{comment}{A Comment object. See \code{\link[=createComment]{createComment()}}.}

\item{xy}{An alternative to specifying \code{col} and
\code{row} individually.  A vector of the form
\code{c(col, row)}.}
}
\description{
Write a Comment object to a worksheet
}
\examples{
wb <- createWorkbook()
addWorksheet(wb, "Sheet 1")

c1 <- createComment(comment = "this is comment")
writeComment(wb, 1, col = "B", row = 10, comment = c1)

s1 <- createStyle(fontSize = 12, fontColour = "red", textDecoration = c("BOLD"))
s2 <- createStyle(fontSize = 9, fontColour = "black")

c2 <- createComment(comment = c("This Part Bold red\n\n", "This part black"), style = c(s1, s2))
c2

writeComment(wb, 1, col = 6, row = 3, comment = c2)
\dontrun{
saveWorkbook(wb, file = "writeCommentExample.xlsx", overwrite = TRUE)
}
}
\seealso{
\code{\link[=createComment]{createComment()}}
}