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

is.sorted.integer64

Small cache access methods


Description

These methods are packaged here for methods in packages bit64 and ff.

Usage

## S3 method for class 'integer64'
is.sorted(x, ...)
	## S3 method for class 'integer64'
na.count(x, ...)
	## S3 method for class 'integer64'
nvalid(x, ...)
	## S3 method for class 'integer64'
nunique(x, ...)
	## S3 method for class 'integer64'
nties(x, ...)

Arguments

x

some object

...

ignored

Details

All these functions benefit from a sortcache, ordercache or sortordercache. na.count, nvalid and nunique also benefit from a hashcache.
is.sorted checks for sortedness of x (NAs sorted first)
na.count returns the number of NAs
nvalid returns the number of valid data points, usually length minus na.count.
nunique returns the number of unique values
nties returns the number of tied values.

Value

is.sorted returns a logical scalar, the other methods return an integer scalar.

Note

If a cache exists but the desired value is not cached, then these functions will store their result in the cache. We do not consider this a relevant side-effect, since these small cache results do not have a relevant memory footprint.

Author(s)

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

See Also

cache for caching functions and sortordercache for functions creating big caches

Examples

x <- as.integer64(sample(c(rep(NA, 9), 1:9), 32, TRUE))
 length(x)
 na.count(x)
 nvalid(x)
 nunique(x)
 nties(x)
 table.integer64(x)
 x

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.