write.xlsx_gV: Write a List of Data Frame to a Vertically Stacked layout in...

View source: R/xl-write.R

write.xlsx_gVR Documentation

Write a List of Data Frame to a Vertically Stacked layout in xlsx file

Description

Write a list of data frames to each worksheets (tabs) in which each data frames are vertically stacked. A wrapper around writeData_gridVertical().

Usage

write.xlsx_gV(
  ...,
  file,
  overwrite = FALSE,
  startCol = 1,
  startRow = 1,
  gapRow = 1,
  headerStyle = NULL,
  borders = "columns",
  freezePane_args = list(),
  writeData_args = list()
)

Arguments

...

One or more named list of data frames. Using syntax tab_name = list_of_dfs

file

A file path to save the xlsx file

overwrite

If 'TRUE' will save over 'file' if present

startCol

(Numeric vector of length 1) specifying the starting column to write to.

startRow

(Numeric vector of length 1) specifying the starting row of the first data frame to write to.

gapRow

(Numeric vector of length 1) specifying number of empty rows (gaps) between each data frame

headerStyle

Custom style to apply to column names. If NULL, generate style automatically. Can input as openxlsx::createStyle() objects.

borders

Either "none" (default), "surrounding", "columns", "rows" or respective abbreviations. If "surrounding", a border is drawn around the data. If "rows", a surrounding border is drawn with a border around each row. If "columns", a surrounding border is drawn with a border between each column. If "all" all cell borders are drawn.

freezePane_args

list of arguments pass to openxlsx::freezePane() (can be recycled to each tabs)

writeData_args

list of arguments pass to openxlsx::writeData()

Value

Workbook object (invisible)

Examples

if(FALSE){
 # not run
 write.xlsx_gV(
 tab1 = list(iris[1:2, ], mtcars),
 tab2 = list(Orange[1:3, ], mtcars),
 file = "path/to/excel-output.xlsx"
 )
}

Lightbridge-KS/lbdoc documentation built on May 16, 2024, 3:03 p.m.