| sort.integer64 | R Documentation |
Fast high-level methods for sorting and ordering. These are wrappers to
ramsort.integer64() and friends and do not modify their arguments.
## 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
)
x |
a vector to be sorted by |
decreasing |
boolean scalar telling ramsort whether to sort increasing or decreasing |
has.na |
boolean scalar defining whether the input vector might
contain |
na.last |
boolean scalar telling ramsort whether to sort |
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 |
see sort() and order()
sort returns the sorted vector and vector returns the order positions.
sort(), sortcache()
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(x)
message("slower with less RAM, this calls 'ramsortorder'")
order(x, optimize="memory")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.