Learn R Programming

openxlsx2 (version 0.6.1)

wb_copy_cells: copy cells around

Description

copy cells around

Usage

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

Value

the wbWorkbook invisibly

Arguments

wb

workbook

sheet

a worksheet

dims

cell used as start

data

a wb_data object

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

See Also

Other workbook wrappers: wb_add_chartsheet(), wb_add_data_table(), wb_add_data(), wb_add_formula(), wb_add_pivot_table(), wb_add_worksheet(), wb_clone_worksheet(), wb_creators, wb_freeze_pane(), wb_get_base_font(), wb_save(), wb_set_col_widths(), wb_set_last_modified_by(), wb_set_row_heights(), wb_workbook(), workbook_grouping, ws_cell_merge

Examples

Run this code
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", colNames = FALSE)

wb$
  # 1:1 copy to M2
  clone_worksheet(old = 1, new = "Clone1")$
  copy_cells(data = dat, dims = "M2")

Run the code above in your browser using DataLab