| hi | R Documentation |
Class for hybrid index representation, plain and rle-packed
hi(from, to, by = 1L, maxindex = NA, vw = NULL, pack = TRUE, NAs = NULL)
## S3 method for class 'hi'
print(x, ...)
## S3 method for class 'hi'
str(object, nest.lev=0, ...)
from |
integer vector of lower sequence bounds |
to |
integer vector of upper sequence bounds |
by |
integer of stepsizes |
maxindex |
maximum indep position (needed for negative indices) |
vw |
virtual window information, see |
pack |
FALSE to suppress rle-packing |
NAs |
a vector of NA positions (not yet used) |
x |
an object of class 'hi' to be printed |
object |
an object of class 'hi' to be str'ed |
nest.lev |
current nesting level in the recursive calls to str |
... |
further arguments passed to the next method |
Class hi will represent index data either as a plain positive or negative index vector or as an rle-packed version thereof.
The current implementation switches from plain index positions i to rle-packed storage of diff(i) as soon as the compression ratio is 3 or higher.
Note that sequences shorter than 2 must never be packed (could cause C-side crash).
Furthermore hybrid indices are guaranteed to be sorted ascending, which helps ffs access method avoiding to swap repeatedly over the same memory pages (or file positions).
A list of class 'hi' with components
x |
directly accessed by the C-code: the sorted index of class 'rlepack' as returned by |
ix |
NULL or positions to restore original order |
re |
logical scalar indicating if sequence was reversed from descending to ascending (in this case |
minindex |
directly accessed by the C-code: represents the lowest positive subscript to be enumerated in case of negative subscripts |
maxindex |
directly accessed by the C-code: represents the highest positive subscript to be enumerated in case of negative subscripts |
length |
number of subscripts, whether negative or positive, not the number of selected elements |
dim |
NULL or dim – used by |
dimorder |
NULL or |
symmetric |
logical scalar indicating whether we have a symmetric matrix |
fixdiag |
logical scalar indicating whether we have a fixed diagonal (can only be true for symmetric matrices) |
vw |
virtual window information |
NAs |
NULL or NA positions as returned by |
hi defines the class structure, however usually as.hi is used to acturally Hybrid Index Preprocessing for ff
Jens Oehlschlägel
as.hi for coercion, rlepack, intrle, maxindex, poslength
hi(c(1, 11, 29), c(9, 19, 21), c(1,1,-2))
as.integer(hi(c(1, 11, 29), c(9, 19, 21), c(1,1,-2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.