R: Hybrid Index, querying

length.hi {ff} | R Documentation

## Hybrid Index, querying

### Description

Functions to query some index attributes

### Usage

    ## S3 method for class 'hi'
    length(x)
    maxindex(x, ...)
    poslength(x, ...)
    ## S3 method for class 'hi'
    maxindex(x, ...)
    ## S3 method for class 'ri'
    maxindex(x, ...)
    ## S3 method for class 'bit'
    maxindex(x, ...)
    ## S3 method for class 'bitwhich'
    maxindex(x, ...)
    ## S3 method for class 'logical'
    maxindex(x, ...)
    ## Default S3 method:
    maxindex(x, ...)
    ## S3 method for class 'hi'
    poslength(x, ...)
    ## S3 method for class 'ri'
    poslength(x, ...)
    ## S3 method for class 'bit'
    poslength(x, ...)
    ## S3 method for class 'bitwhich'
    poslength(x, ...)
    ## S3 method for class 'logical'
    poslength(x, ...)
    ## Default S3 method:
    poslength(x, ...)

### Arguments

`x` | an object of class `hi`
`...` | further arguments (not used)

### Details

`length.hi` returns the number of the subsript elements in the index (even if they are negative). By contrast the generic `poslength` returns the number of selected elements (which for negative indices is `maxindex(x) - length(unique(x))`). The generic `maxindex` returns the highest possible index position.

### Value

an integer scalar

### Note

duplicated negative indices are removed

### Author(s)

Jens Oehlschlägel

### See Also

`hi`, `as.hi`, `length.ff`, `length`

### Examples

      length(as.hi(-1, maxindex=12))
      poslength(as.hi(-1, maxindex=12))
      maxindex(as.hi(-1, maxindex=12))
      message("note that")
      length(as.hi(c(-1, -1), maxindex=12))
      length(as.hi(c(1,1), maxindex=12))

[Package ff version 2.2-13 Index]