divide: Divide table

View source: R/pivot_table.R

divideR Documentation

Divide table

Description

Divides a table into tables separated by some empty row or column. Returns a pivot_table object list.

Usage

divide(pt)

## S3 method for class 'pivot_table'
divide(pt)

Arguments

pt

A pivot_table object.

Details

Sometimes multiple pivot tables are placed in a text document, imported as one text table. This operation recursively divides the initial table into tables separated by some empty row or column. Once a division has been made, it tries to divide each part of the result. An object is generated for each indivisible pivot table. Returns a list of pivot_table objects.

If individual tables have a header or footer, they should not be separated from the table by empty rows. If they were, objects would be generated from them that must later be removed from the list of objects in the result.

The operation can be applied to tables located horizontally, vertically or in a grid on the initial table. The only requirement to be able to divide it is that there is some empty row or column between them.

Value

A pivot_table list.

See Also

pivot_table

Other flat table list functions: flatten_table_list(), get_col_values()

Examples


pt <- pivot_table(df_set_h_v)
lpt <- pt |> divide()


flattabler documentation built on Sept. 15, 2023, 1:06 a.m.