Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sort.integer64

High-level intger64 methods for sorting and ordering


Description

Fast high-level methods for sorting and ordering. These are wrappers to ramsort and friends and do not modify their arguments.

Usage

## S3 method for class 'integer64'
sort(x, decreasing = FALSE, has.na = TRUE, na.last = TRUE, stable = TRUE
, optimize = c("time", "memory"), VERBOSE = FALSE, ...)
## S3 method for class 'integer64'
order(..., na.last = TRUE, decreasing = FALSE, has.na = TRUE, stable = TRUE
, optimize = c("time", "memory"), VERBOSE = FALSE)

Arguments

x

a vector to be sorted by ramsort and ramsortorder, i.e. the output of sort

has.na

boolean scalar defining whether the input vector might contain NAs. If we know we don't have NAs, this may speed-up. Note that you risk a crash if there are unexpected NAs with has.na=FALSE

na.last

boolean scalar telling ramsort whether to sort NAs last or first. Note that 'boolean' means that there is no third option NA as in sort

decreasing

boolean scalar telling ramsort whether to sort increasing or decreasing

stable

boolean scalar defining whether stable sorting is needed. Allowing non-stable may speed-up.

optimize

by default ramsort optimizes for 'time' which requires more RAM, set to 'memory' to minimize RAM requirements and sacrifice speed

VERBOSE

cat some info about chosen method

...

further arguments, passed from generics, ignored in methods

Details

see sort and order

Value

sort returns the sorted vector and vector returns the order positions.

Author(s)

Jens Oehlschlägel <Jens.Oehlschlaegel@truecluster.com>

See Also

Examples

x <- as.integer64(sample(c(rep(NA, 9), 1:9), 32, TRUE))
  x
  sort(x)
  message("the following has default optimize='time' which is faster but requires more RAM
, this calls 'ramorder'")
  order.integer64(x)
  message("slower with less RAM, this calls 'ramsortorder'")
  order.integer64(x, optimize="memory")

bit64

A S3 Class for Vectors of 64bit Integers

v4.0.5
GPL-2 | GPL-3
Authors
Jens Oehlschlägel [aut, cre], Leonardo Silvestri [ctb]
Initial release
2020-08-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.