Learn R Programming

openxlsx2 (version 0.8)

wb_add_person: add threaded comment to worksheet

Description

These functions allow adding thread comments to spreadsheets. This is not yet supported by all spreadsheet software.

Usage

wb_add_person(wb, name = NULL, id = NULL, user_id = NULL, provider_id = "None")

wb_get_person(wb, name = NULL)

wb_add_thread( wb, sheet = current_sheet(), dims = "A1", comment = NULL, person_id, reply = FALSE, resolve = FALSE )

Arguments

wb

a workbook

name

the name to display

id

(optional) the display id

user_id

(optional) the user id

provider_id

(optional) the provider id

sheet

a worksheet

dims

a cell

comment

the comment to add

person_id

the person Id this should be added for

reply

logical if the comment is a reply

resolve

logical if the comment should be marked as resolved

Details

If a threaded comment is added, it needs a person attached with it. The default is to create a person with provider id "None". Other providers are possible with specific values for id and user_id. If you require the following, create a workbook via spreadsheet software load it and get the values with wb_get_person()

See Also

wb_add_comment()

Examples

Run this code
wb <- wb_workbook()$add_worksheet()$
add_person(name = "openxlsx2")

pid <- wb$get_person(name = "openxlsx")$id

# write a comment to a thread, reply to one and solve some
wb <- wb %>%
  wb_add_thread(dims = "A1", comment = "wow it works!", person_id = pid) %>%
  wb_add_thread(dims = "A2", comment = "indeed", person_id = pid, resolve = TRUE) %>%
  wb_add_thread(dims = "A1", comment = "so cool", person_id = pid, reply = TRUE)

Run the code above in your browser using DataLab