Learn R Programming

flattabler (version 2.1.2)

get_col_values: Get column values

Description

Gets the values of the indicated column of each table in a list of tables, avoiding the rows at the beginning or the end of each table that are indicated.

Usage

get_col_values(lpt, col = 1, start_row = 2, rows_left = 0)

Value

Data frame with two columns: Labels in the column, and the index of the table in the list of tables from which they come.

Arguments

lpt

pivot_table object list.

col

A number, column to consider.

start_row

A number, start row in each table.

rows_left

A number, rows to ignore at the end of each table.

Details

Sometimes a column includes values of multiple label fields. To facilitate the study of the labels included in the same column of several tables, this function gets the values of the indicated column in a list of tables.

See Also

pivot_table

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

Examples

Run this code

pt <- pivot_table(df_set_h_v)
lpt <- pt |> divide()
df <- get_col_values(lpt, col = 1, start_row = 4)
labels <- sort(unique(df$label))

Run the code above in your browser using DataLab