sort,HistDat-method {HistDat}R Documentation

This is a dummy method so that sort can be applied to HistDat entries However it does nothing, because the values in a HistDat are sorted at the time of creation.

Description

This is a dummy method so that sort can be applied to HistDat entries However it does nothing, because the values in a HistDat are sorted at the time of creation.

Usage

## S4 method for signature 'HistDat'
sort(x, decreasing = F, ...)

Arguments

x

HistDat A HistDat instance

decreasing

If TRUE, this function will fail, as the observations are sorted in ascending order by default and this cannot be changed

...

Additional arguments allowed for compatibility that will be ignored

Details

An S3 and and S4 generic is defined for this method, allowing compatibility with existing code that calls base::sort() instead of ⁠[sort()]⁠, which is defined as an S4 generic in this package

Value

The same HistDat instance, completely unchanged

Examples

hd <- HistDat(vals = 1:3, counts = c(1, 2, 1))
sort(hd) # returns `hd` verbatim

[Package HistDat version 0.2.0 Index]