R6 class for a Workbook Worksheet
R6 class for a Workbook Worksheet
The wbWorksheet object
The wbWorksheet object
sheetPrsheetPr
dimensiondimension
sheetViewssheetViews
sheetFormatPrsheetFormatPr
sheet_datasheet_data
cols_attrcols_attr
autoFilterautoFilter
mergeCellsmergeCells
conditionalFormattingconditionalFormatting
dataValidationsdataValidations
freezePanefreezePane
hyperlinkshyperlinks
sheetProtectionsheetProtection
pageMarginspageMargins
pageSetuppageSetup
headerFooterheaderFooter
rowBreaksrowBreaks
colBreakscolBreaks
drawingdrawing
legacyDrawinglegacyDrawing
legacyDrawingHFlegacyDrawingHF
oleObjectsoleObjects
tablePartstableParts
extLstextLst
cellWatchescellWatches
controlscontrols
customPropertiescustomProperties
customSheetViewscustomSheetViews
dataConsolidatedataConsolidate
drawingHFdrawingHF
relshipsrelships
ignoredErrorsignoredErrors
phoneticPrphoneticPr
picturepicture
printOptionsprintOptions
protectedRangesprotectedRanges
scenariosscenarios
sheetCalcPrsheetCalcPr
smartTagssmartTags
sortStatesortState
webPublishItemswebPublishItems
new()Creates a new wbWorksheet object
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
)tabColortabColor
oddHeaderoddHeader
oddFooteroddFooter
evenHeaderevenHeader
evenFooterevenFooter
firstHeaderfirstHeader
firstFooterfirstFooter
paperSizepaperSize
orientationorientation
hdpihdpi
vdpivdpi
printGridLinesprintGridLines
a wbWorksheet object
get_prior_sheet_data()Get prior sheet data
wbWorksheet$get_prior_sheet_data()A character vector of xml
get_post_sheet_data()Get post sheet data
wbWorksheet$get_post_sheet_data()A character vector of xml
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?
wbWorksheet$unfold_cols()The column data frame
fold_cols()fold the column dataframe back into a node.
wbWorksheet$fold_cols(col_df)col_dfthe column data frame
The wbWorksheetObject, invisibly
merge_cells()Set cell merging for a sheet
wbWorksheet$merge_cells(rows = NULL, cols = NULL)rows, colsRow and column specifications.
The wbWorkbook object, invisibly
unmerge_cells()Removes cell merging for a sheet
wbWorksheet$unmerge_cells(rows = NULL, cols = NULL)rows, colsRow and column specifications.
The wbWorkbook object, invisibly
clean_sheet()clean sheet (remove all values)
wbWorksheet$clean_sheet(
dims = NULL,
numbers = TRUE,
characters = TRUE,
styles = TRUE,
merged_cells = TRUE
)dimsdimensions
numbersremove all numbers
charactersremove all characters
stylesremove all styles
merged_cellsremove all merged_cells
The wbWorksheetObject, invisibly
add_page_break()add page break
wbWorksheet$add_page_break(row = NULL, col = NULL)rowrow
colcol
set_print_options()add print options
wbWorksheet$set_print_options(
gridLines = NULL,
gridLinesSet = NULL,
headings = NULL,
horizontalCentered = NULL,
verticalCentered = NULL
)gridLinesgridLines
gridLinesSetgridLinesSet
headingsIf TRUE prints row and column headings
horizontalCenteredIf TRUE the page is horizontally centered
verticalCenteredIf TRUE the page is vertically centered
append()append a field. Intended for internal use only. Not guaranteed to remain a public method.
wbWorksheet$append(field, value = NULL)fielda field name
valuea new value
The wbWorksheetObject, invisibly
add_sparklines()add sparkline
wbWorksheet$add_sparklines(sparklines)sparklinessparkline created by create_sparkline()
The wbWorksheetObject, invisibly
set_sheetview()add sheetview
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
)colorIdcolorId
defaultGridColordefaultGridColor
rightToLeftrightToLeft
showFormulasshowFormulas
showGridLinesshowGridLines
showOutlineSymbolsshowOutlineSymbols
showRowColHeadersshowRowColHeaders
showRulershowRuler
showWhiteSpaceshowWhiteSpace
showZerosshowZeros
tabSelectedtabSelected
topLeftCelltopLeftCell
viewview
windowProtectionwindowProtection
workbookViewIdworkbookViewId
zoomScalezoomScale
zoomScaleNormalzoomScaleNormal
zoomScalePageLayoutViewzoomScalePageLayoutView
zoomScaleSheetLayoutViewzoomScaleSheetLayoutView
The wbWorksheetObject, invisibly
ignore_error()Ignore error on worksheet
wbWorksheet$ignore_error(
dims = "A1",
calculatedColumn = FALSE,
emptyCellReference = FALSE,
evalError = FALSE,
formula = FALSE,
formulaRange = FALSE,
listDataValidation = FALSE,
numberStoredAsText = FALSE,
twoDigitTextYear = FALSE,
unlockedFormula = FALSE
)dimsdims
calculatedColumncalculatedColumn
emptyCellReferenceemptyCellReference
evalErrorevalError
formulaformula
formulaRangeformulaRange
listDataValidationlistDataValidation
numberStoredAsTextnumberStoredAsText
twoDigitTextYeartwoDigitTextYear
unlockedFormulaunlockedFormula
The wbWorksheetObject, invisibly
clone()The objects of this class are cloneable with this method.
wbWorksheet$clone(deep = FALSE)deepWhether to make a deep clone.
A Worksheet