intrle: Hybrid Index, C-coded utilities

Description Usage Arguments Details Value Author(s) See Also Examples

Description

These C-coded utilitites speed up index preprocessing considerably

Usage

1
2
3

Arguments

x

an integer vector

Details

intrle is by factor 50 faster and needs less RAM (2x its input vector) compared to rle which needs 9x the RAM of its input vector. This is achieved because we allow the C-code of intrle to break when it turns out, that rle-packing will not achieve a compression factor of 3 or better.
intisasc is a faster version of is.unsorted: it checks whether x is sorted and returns NA x contains NAs.
intisdesc checks for being sorted descending and assumes that the input x contains no NAs (is used after intisasc and does not check for NAs).

Value

intrle returns an object of class rle or NULL, if rle-compression is not efficient (compression factor <3 or length(x)<3).
intisasc returns one of FALSE, NA, TRUE
intisdesc returns one of FALSE, TRUE (if the input contains NAs, the output is undefined)

Author(s)

Jens Oehlschlägel

See Also

hi, rle, is.unsorted, is.sorted

Examples

1
2
3
4
5
6
7
  intrle(sample(1:100))
  intrle(diff(1:100))
  intisasc(1:100)
  intisasc(100:1)
  intisasc(c(NA, 1:100))
  intisdesc(1:100)
  intisdesc(100:1)

OHDSI/bit documentation built on May 7, 2019, 8:30 p.m.