Learn R Programming

HistDat (version 0.2.0)

sort,HistDat-method: 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 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

Value

The same HistDat instance, completely unchanged

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

Examples

Run this code
# NOT RUN {
hd <- HistDat(vals = 1:3, counts = c(1, 2, 1))
sort(hd) # returns `hd` verbatim
# }

Run the code above in your browser using DataLab