Skip to contents

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

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")