% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/xl_comment.R
\name{xl_comment}
\alias{xl_comment}
\title{Create a cell comment}
\usage{
xl_comment(
  value,
  format = NULL,
  author = NA,
  visible = NA,
  width_pixels = NA,
  height_pixels = NA,
  x_scale = NA,
  y_scale = NA,
  start_row = NA,
  start_col = NA,
  x_offset = NA,
  y_offset = NA
)
}
\arguments{
\item{value}{A single string: the comment's text.  Anything with an
[as.character()] method is accepted, so a cell built for a sheet can be
reused here.}

\item{format}{An optional [xl_format]; only its fill background color and
font name/size/family are used (see [xl_fill()], [xl_font()]).  Other
properties are unsupported and warned about.}

\item{author}{Comment author (shown in Excel's status bar).  Defaults to the
sheet/workbook `comment_author` when unset (see [xl_sheet()],
[xl_properties()]).}

\item{visible}{Initial visibility: `NA` follows the sheet default (comments
are hidden unless `show_comments` is set), `TRUE` shows this comment,
`FALSE` hides it.}

\item{width_pixels, height_pixels}{Comment box size in pixels (defaults
128 x 74).}

\item{x_scale, y_scale}{Box scale factors.}

\item{start_row, start_col}{Zero-based anchor cell of the box (by default a
comment sits one row up and one column right of its cell).}

\item{x_offset, y_offset}{Pixel offset of the box from its anchor.}
}
\value{
An `xl_comment` object.
}
\description{
`xl_comment()` builds a comment (note) that can be attached to a cell via
[xl_cell_general()]'s `comment` argument.  The simplest form is just text
(`xl_cell_general(value = x, comment = "see note")`); `xl_comment()` adds
options such as the author, initial visibility, box size and position, and
styling.

Excel comment boxes support only a **background color** and a **font
name/size/family**.  These are supplied by reusing the formatting engine via
the `format` argument (e.g. `xl_font(name = "Arial", size = 10) +
xl_fill(background = "lightyellow")`); any other format property (bold,
borders, number formats, ...) is not supported by comments and triggers a
warning.
}
\examples{
# plain text
xl_comment("Double-check this figure")

# with author and styling reused from the format engine
xl_comment("Estimate", author = "Finance",
           format = xl_font(name = "Arial", size = 10) +
                    xl_fill(background = "lightyellow"))
}
\seealso{
[xl_cell_general], [xl_format]

Other cell content:
\code{\link[=is_xl_comment]{is_xl_comment()}},
\code{\link[=xl_cell_general]{xl_cell_general()}},
\code{\link[=xl_formula]{xl_formula()}},
\code{\link[=xl_rich_run]{xl_rich_run()}},
\code{\link[=xl_rich_string]{xl_rich_string()}}
}
\concept{cell content}
