make_sorters: Make sorters for pivot table

View source: R/hjelpefunksjoner.R

make_sortersR Documentation

Make sorters for pivot table

Description

For all factor-variables, get the order of levels and use this as input in rpivottable.

Usage

make_sorters(df)

Arguments

df

ablanor table

Value

a text string containing a function that defines the sorters for each factor-variable. This should be given in input in the getPivotTable from shiny

Examples

df <- data.frame(kjonn = factor(x = c("M", "K", "M", "M"),
                                levels = c("M", "K"),
                                ordered = TRUE))
s <- ablanor::make_sorters(df)
s
## Not run: 
rpivotTable::rpivotTable(df, sorters = make_sorters(df, sorters =))

## End(Not run)

Rapporteket/ablanor documentation built on Feb. 27, 2025, 8:26 p.m.