wb_copy_cells: Copy cells around within a worksheet

View source: R/class-workbook-wrappers.R

wb_copy_cellsR Documentation

Copy cells around within a worksheet

Description

Copy cells around within a worksheet

Usage

wb_copy_cells(
  wb,
  sheet = current_sheet(),
  dims = "A1",
  data,
  as_value = FALSE,
  as_ref = FALSE,
  transpose = FALSE,
  ...
)

Arguments

wb

A workbook

sheet

a worksheet

dims

A cell where to place the copy

data

A wb_data object containing cells to copy

as_value

Should a copy of the value be written?

as_ref

Should references to the cell be written?

transpose

Should the data be written transposed?

...

additional arguments passed to add_data() if used with as_value

Value

the wbWorkbook invisibly

See Also

wb_data()

Other workbook wrappers: base_font-wb, col_widths-wb, creators-wb, grouping-wb, row_heights-wb, wb_add_chartsheet(), wb_add_data(), wb_add_data_table(), wb_add_formula(), wb_add_hyperlink(), wb_add_pivot_table(), wb_add_slicer(), wb_add_worksheet(), wb_base_colors, wb_clone_worksheet(), wb_freeze_pane(), wb_merge_cells(), wb_save(), wb_set_last_modified_by(), wb_workbook()

Examples

wb <- wb_workbook()$
add_worksheet()$
  add_data(x = mtcars)$
  add_fill(dims = "A1:F1", color = wb_color("yellow"))

dat <- wb_data(wb, dims = "A1:D4", col_names = FALSE)
# 1:1 copy to M2
wb$
  clone_worksheet(old = 1, new = "Clone1")$
  copy_cells(data = dat, dims = "M2")

openxlsx2 documentation built on Oct. 18, 2024, 1:07 a.m.