lineupRanking {lineupjs}R Documentation

helper function for creating a LineUp ranking definition as used by lineup

Description

helper function for creating a LineUp ranking definition as used by lineup

Usage

lineupRanking(columns = c("_*", "*"), sortBy = c(), groupBy = c(), ...)

Arguments

columns

list of columns shown in this ranking, besides column names of the given data frame following special columns are available

sortBy

list of columns to sort this ranking by, grammar: "<column name>[:desc]"

groupBy

list of columns to group this ranking by

...

additional ranking combination definitions as lists (list(type = 'min', columns = c('a', 'b'), label = NULL)), possible types

Value

a configured lineup ranking config

Special columns

'* '

include all data frame columns

'_* '

add multiple support columns (_aggregate, _rank, _selection)

'_aggregate'

add a column for collapsing groups

'_rank'

add a column for showing the rank of the item

'_selection'

add a column with checkboxes for selecting items

'_group'

add a column showing the current grouping title

'$data.frame column$'

add the specific column

'$def column$'

add defined column given as additional parameter to this function, see below

Ranking definition types

weightedSum

a weighted sum of multiple numeric columns, extras list(weights = c(0.4, 0.6))

min

minimum of multiple numeric columns

max

maximum of multiple numeric columns

mean

mean of multiple numeric columns

median

median of multiple numeric columns

nested

group multiple columns

script

scripted (JS code) combination of multiple numeric columns, extras list(code = '...')

impose

color a numerical column (column) with the color of a categorical column (categoricalColumn), changed list(column = 'a', categoricalColumn = 'b')

Examples

lineupRanking(columns = c("*"))
lineupRanking(columns = c("*"), sortBy = c("hp"))
lineupRanking(
  columns = c("*", "sum"),
  sum = list(type = "weightedSum", columns = c("hp", "wt"), weights = c(0.7, 0.3))
)

[Package lineupjs version 4.6.0 Index]