Learn R Programming

openxlsx2 (version 0.6.1)

wbWorksheet: R6 class for a Workbook Worksheet

Description

R6 class for a Workbook Worksheet

R6 class for a Workbook Worksheet

Arguments

Value

The wbWorksheet object

The wbWorksheet object

Public fields

sheetPr

sheetPr

dimension

dimension

sheetViews

sheetViews

sheetFormatPr

sheetFormatPr

sheet_data

sheet_data

cols_attr

cols_attr

autoFilter

autoFilter

mergeCells

mergeCells

conditionalFormatting

conditionalFormatting

dataValidations

dataValidations

freezePane

freezePane

hyperlinks

hyperlinks

sheetProtection

sheetProtection

pageMargins

pageMargins

pageSetup

pageSetup

headerFooter

headerFooter

rowBreaks

rowBreaks

colBreaks

colBreaks

drawing

drawing

legacyDrawing

legacyDrawing

legacyDrawingHF

legacyDrawingHF

oleObjects

oleObjects

tableParts

tableParts

extLst

extLst

cellWatches

cellWatches

controls

controls

customProperties

customProperties

customSheetViews

customSheetViews

dataConsolidate

dataConsolidate

drawingHF

drawingHF

relships

relships

ignoredErrors

ignoredErrors

phoneticPr

phoneticPr

picture

picture

printOptions

printOptions

protectedRanges

protectedRanges

scenarios

scenarios

sheetCalcPr

sheetCalcPr

smartTags

smartTags

sortState

sortState

webPublishItems

webPublishItems

Methods


Method new()

Creates a new wbWorksheet object

Usage

wbWorksheet$new(
  tabColor = NULL,
  oddHeader = NULL,
  oddFooter = NULL,
  evenHeader = NULL,
  evenFooter = NULL,
  firstHeader = NULL,
  firstFooter = NULL,
  paperSize = 9,
  orientation = "portrait",
  hdpi = 300,
  vdpi = 300,
  printGridLines = FALSE
)

Arguments

tabColor

tabColor

oddHeader

oddHeader

oddFooter

oddFooter

evenHeader

evenHeader

evenFooter

evenFooter

firstHeader

firstHeader

firstFooter

firstFooter

paperSize

paperSize

orientation

orientation

hdpi

hdpi

vdpi

vdpi

printGridLines

printGridLines

Returns

a wbWorksheet object


Method get_prior_sheet_data()

Get prior sheet data

Usage

wbWorksheet$get_prior_sheet_data()

Returns

A character vector of xml


Method get_post_sheet_data()

Get post sheet data

Usage

wbWorksheet$get_post_sheet_data()

Returns

A character vector of xml


Method unfold_cols()

unfold <cols ..> node to dataframe. <cols><col ..> are compressed. Only columns with attributes are written to the file. This function unfolds them so that each cell beginning with the "A" to the last one found in cc gets a value. TODO might extend this to match either largest cc or largest col. Could be that "Z" is formatted, but the last value is written to "Y". TODO might replace the xml nodes with the data frame?

Usage

wbWorksheet$unfold_cols()

Returns

The column data frame


Method fold_cols()

fold the column dataframe back into a node.

Usage

wbWorksheet$fold_cols(col_df)

Arguments

col_df

the column data frame

Returns

The wbWorksheetObject, invisibly


Method merge_cells()

Set cell merging for a sheet

Usage

wbWorksheet$merge_cells(rows = NULL, cols = NULL)

Arguments

rows, cols

Row and column specifications.

Returns

The wbWorkbook object, invisibly


Method unmerge_cells()

Removes cell merging for a sheet

Usage

wbWorksheet$unmerge_cells(rows = NULL, cols = NULL)

Arguments

rows, cols

Row and column specifications.

Returns

The wbWorkbook object, invisibly


Method clean_sheet()

clean sheet (remove all values)

Usage

wbWorksheet$clean_sheet(
  dims = NULL,
  numbers = TRUE,
  characters = TRUE,
  styles = TRUE,
  merged_cells = TRUE
)

Arguments

dims

dimensions

numbers

remove all numbers

characters

remove all characters

styles

remove all styles

merged_cells

remove all merged_cells

Returns

The wbWorksheetObject, invisibly


Method add_page_break()

add page break

Usage

wbWorksheet$add_page_break(row = NULL, col = NULL)

Arguments

row

row

col

col


Method set_print_options()

add print options

Usage

wbWorksheet$set_print_options(
  gridLines = NULL,
  gridLinesSet = NULL,
  headings = NULL,
  horizontalCentered = NULL,
  verticalCentered = NULL
)

Arguments

gridLines

gridLines

gridLinesSet

gridLinesSet

headings

If TRUE prints row and column headings

horizontalCentered

If TRUE the page is horizontally centered

verticalCentered

If TRUE the page is vertically centered


Method append()

append a field. Intended for internal use only. Not guaranteed to remain a public method.

Usage

wbWorksheet$append(field, value = NULL)

Arguments

field

a field name

value

a new value

Returns

The wbWorksheetObject, invisibly


Method add_sparklines()

add sparkline

Usage

wbWorksheet$add_sparklines(sparklines)

Arguments

sparklines

sparkline created by create_sparkline()

Returns

The wbWorksheetObject, invisibly


Method set_sheetview()

add sheetview

Usage

wbWorksheet$set_sheetview(
  colorId = NULL,
  defaultGridColor = NULL,
  rightToLeft = NULL,
  showFormulas = NULL,
  showGridLines = NULL,
  showOutlineSymbols = NULL,
  showRowColHeaders = NULL,
  showRuler = NULL,
  showWhiteSpace = NULL,
  showZeros = NULL,
  tabSelected = NULL,
  topLeftCell = NULL,
  view = NULL,
  windowProtection = NULL,
  workbookViewId = NULL,
  zoomScale = NULL,
  zoomScaleNormal = NULL,
  zoomScalePageLayoutView = NULL,
  zoomScaleSheetLayoutView = NULL
)

Arguments

colorId

colorId

defaultGridColor

defaultGridColor

rightToLeft

rightToLeft

showFormulas

showFormulas

showGridLines

showGridLines

showOutlineSymbols

showOutlineSymbols

showRowColHeaders

showRowColHeaders

showRuler

showRuler

showWhiteSpace

showWhiteSpace

showZeros

showZeros

tabSelected

tabSelected

topLeftCell

topLeftCell

view

view

windowProtection

windowProtection

workbookViewId

workbookViewId

zoomScale

zoomScale

zoomScaleNormal

zoomScaleNormal

zoomScalePageLayoutView

zoomScalePageLayoutView

zoomScaleSheetLayoutView

zoomScaleSheetLayoutView

Returns

The wbWorksheetObject, invisibly


Method clone()

The objects of this class are cloneable with this method.

Usage

wbWorksheet$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

A Worksheet