suppfun: Convert various datasets to support functions.

suppfunR Documentation

Convert various datasets to support functions.

Description

Function suppfun() is an S3 generic that returns a support function, dispatching on the class of its primary argument.

Usage

## S3 method for class 'ordertable'
suppfun(x, ...)
## S3 method for class 'ranktable'
suppfun(x, times, ...)
## S3 method for class 'character'
suppfun(x, nonfinishers, ...)
suppfun(x, ...)

Arguments

x

Dataset to be converted to a support function

times

Vector corresponding to rows of x giving how many times that observation was obtained (cf preflib datasets); recycled if necessary

nonfinishers

Character vector of competitors who did not finish, passed to rankvec_likelihood()

...

Further arguments

Details

Function suppfun() is intended as a consistent S3 generic approach to converting datasets to support functions. I am gradually going to switch out use of ordertable2supp() in favour of suppfun() in the docs.

If given a data frame, suppfun() will not guess whether it is to be interpreted as an ordertable or a ranktable, and return an error.

Value

Generally, return a support function

Author(s)

Robin K. S. Hankin

Examples


suppfun(pentathlon_table)
suppfun(rrank(10, p = (7:1)/28))
suppfun(letters)
suppfun(c(c = 2, b = 1, a = 3))




RobinHankin/hyper2 documentation built on April 13, 2025, 9:33 a.m.