In This Vignette

  • High Level Methods vs. Low Level Methods
  • Navigating Data Groups
  • Navigating Cells
  • Navigating between data groups and rows / columns / cells

High Level Methods vs. Low Level Methods

Most of the previous vignettes have utilised “high-level” methods to relatively quickly build a pivot table with a minimum of code and without having to worry about low-level structures and layout. Such high-level methods include:

  • qpvt(), qhpvt() and qlpvt() to build and output an entire pivot table in a single function call.
  • pt$addColumnDataGroups() and pt$addRowDataGroups() - to add multiple column/row data groups in a single method call.
  • pt$evaluatePivot() - to execute all of the following if they have not yet been executed:
    • pt$normaliseColumnGroups() - to ensure all of the column data groups have the same depth.
    • pt$normaliseRowGroups() - to ensure all of the row data groups have the same depth.
    • pt$generateCellStructure() - to generate the (uncalculated) cells.
    • pt$evaluateCells() - to calculate the cells.
  • pt$renderPivot()- to execute pt$evaluatePivot() if not already executed and then output the pivot table as an htmlwidget.
  • pt$findColumnDataGroups() and pt$findRowDataGroups() to select data groups matching specific criteria in a single method call.
  • pt$getCells() and pt$findCells() to select cells matching specific criteria in a single method call.

All of the above methods serve to make creating or navigating a pivot table quicker and easier in most circumstances.

Sometimes however, a more unusual or complex pivot table needs creating or more granular navigation of the pivot table structures is needed. The pivottabler package includes a set of lower-level methods to create and navigate a pivot table. Using these methods provides more flexibility but also requires more effort and more lines of code than using the high-level methods above.

This vignette describes the set of low-level methods for navigating a pivot table.

The Irregular Layout vignette describes the low-level methods for creating a pivot table.