diff --git a/R/class-comment.R b/R/class-comment.R index 0292b0c41..41235bc7f 100644 --- a/R/class-comment.R +++ b/R/class-comment.R @@ -171,15 +171,21 @@ create_comment <- function(text, invisible(wbComment$new(text = text, author = author, style = style, visible = visible, width = width[1], height = height[1])) } +#' Internal comment functions +#' +#' Users are advised to use [wb_add_comment()] and [wb_remove_comment()] +#' @name comment_internal +NULL #' @name write_comment +#' @rdname comment_internal #' @param wb A workbook object #' @param sheet A vector of names or indices of worksheets #' @param col Column a column number of letter. For `remove_comment` this can be a range. #' @param row A row number. For `remove_comment` this can be a range. #' @param comment A Comment object. See [create_comment()]. #' @param dims worksheet cell "A1" -#' @rdname comment +#' @keywords internal #' @export write_comment <- function( wb, @@ -337,9 +343,9 @@ write_comment <- function( #' @name remove_comment +#' @rdname comment_internal #' @param gridExpand If `TRUE`, all data in rectangle min(rows):max(rows) X min(cols):max(cols) #' will be removed. -#' @rdname comment #' @keywords internal #' @export remove_comment <- function( diff --git a/R/class-workbook-wrappers.R b/R/class-workbook-wrappers.R index 79b256f24..4def7f6f3 100644 --- a/R/class-workbook-wrappers.R +++ b/R/class-workbook-wrappers.R @@ -2929,6 +2929,7 @@ wb_add_dxfs_style <- function( #' @param ... additional arguments #' @returns The `wbWorkbook` object #' @seealso [wb_add_thread()] +#' @rdname comment #' @export wb_add_comment <- function( wb, @@ -2950,11 +2951,6 @@ wb_add_comment <- function( } #' Remove comment from worksheet -#' @param wb A workbook object -#' @param sheet A worksheet of the workbook -#' @param dims Optional row and column as spreadsheet dimension, e.g. "A1" -#' @param ... additional arguments -#' @returns The `wbWorkbook` object #' @rdname comment #' @export wb_remove_comment <- function( diff --git a/man/comment.Rd b/man/comment.Rd index db1fdc8b1..ba0015d4c 100644 --- a/man/comment.Rd +++ b/man/comment.Rd @@ -2,8 +2,7 @@ % Please edit documentation in R/class-comment.R, R/class-workbook-wrappers.R \name{create_comment} \alias{create_comment} -\alias{write_comment} -\alias{remove_comment} +\alias{wb_add_comment} \alias{wb_remove_comment} \title{Create, write and remove comments} \usage{ @@ -16,23 +15,7 @@ create_comment( height = 4 ) -write_comment( - wb, - sheet, - col = NULL, - row = NULL, - comment, - dims = rowcol_to_dim(row, col) -) - -remove_comment( - wb, - sheet, - col = NULL, - row = NULL, - gridExpand = TRUE, - dims = NULL -) +wb_add_comment(wb, sheet = current_sheet(), dims = "A1", comment, ...) wb_remove_comment(wb, sheet = current_sheet(), dims = "A1", ...) } @@ -53,16 +36,9 @@ wb_remove_comment(wb, sheet = current_sheet(), dims = "A1", ...) \item{sheet}{A worksheet of the workbook} -\item{col}{Column a column number of letter. For \code{remove_comment} this can be a range.} - -\item{row}{A row number. For \code{remove_comment} this can be a range.} - -\item{comment}{A Comment object. See \code{\link[=create_comment]{create_comment()}}.} - \item{dims}{Optional row and column as spreadsheet dimension, e.g. "A1"} -\item{gridExpand}{If \code{TRUE}, all data in rectangle min(rows):max(rows) X min(cols):max(cols) -will be removed.} +\item{comment}{A comment to apply to the worksheet} \item{...}{additional arguments} } @@ -98,4 +74,6 @@ write_comment(wb, 1, col = 6, row = 3, comment = c3) # remove the first comment remove_comment(wb, 1, col = "B", row = 10) } -\keyword{internal} +\seealso{ +\code{\link[=wb_add_thread]{wb_add_thread()}} +} diff --git a/man/comment_internal.Rd b/man/comment_internal.Rd new file mode 100644 index 000000000..c61619689 --- /dev/null +++ b/man/comment_internal.Rd @@ -0,0 +1,46 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/class-comment.R +\name{comment_internal} +\alias{comment_internal} +\alias{write_comment} +\alias{remove_comment} +\title{Internal comment functions} +\usage{ +write_comment( + wb, + sheet, + col = NULL, + row = NULL, + comment, + dims = rowcol_to_dim(row, col) +) + +remove_comment( + wb, + sheet, + col = NULL, + row = NULL, + gridExpand = TRUE, + dims = 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. For \code{remove_comment} this can be a range.} + +\item{row}{A row number. For \code{remove_comment} this can be a range.} + +\item{comment}{A Comment object. See \code{\link[=create_comment]{create_comment()}}.} + +\item{dims}{worksheet cell "A1"} + +\item{gridExpand}{If \code{TRUE}, all data in rectangle min(rows):max(rows) X min(cols):max(cols) +will be removed.} +} +\description{ +Users are advised to use \code{\link[=wb_add_comment]{wb_add_comment()}} and \code{\link[=wb_remove_comment]{wb_remove_comment()}} +} +\keyword{internal} diff --git a/man/wb_add_comment.Rd b/man/wb_add_comment.Rd deleted file mode 100644 index d0064f139..000000000 --- a/man/wb_add_comment.Rd +++ /dev/null @@ -1,28 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/class-workbook-wrappers.R -\name{wb_add_comment} -\alias{wb_add_comment} -\title{Add comment to worksheet} -\usage{ -wb_add_comment(wb, sheet = current_sheet(), dims = "A1", comment, ...) -} -\arguments{ -\item{wb}{A workbook object} - -\item{sheet}{A worksheet of the workbook} - -\item{dims}{Optional row and column as spreadsheet dimension, e.g. "A1"} - -\item{comment}{A comment to apply to the worksheet} - -\item{...}{additional arguments} -} -\value{ -The \code{wbWorkbook} object -} -\description{ -Add comment to worksheet -} -\seealso{ -\code{\link[=wb_add_thread]{wb_add_thread()}} -}