gRbase-utilities {gRbase}R Documentation

Utility functions for gRbase

Description

Utility functions for gRbase package. Includes 'faster versions' of certain standard R functions.

Usage

uniquePrim(x)
setdiffPrim(x,y)
intersectPrim(x,y)
subsetof(x, y)
subsetofList(x, l)
unlistPrim(l, recursive = TRUE, use.names = TRUE)
removeRedundant(l, maximal=TRUE, index=FALSE)

Arguments

x, y Vectors
l A list (of vectors)
recursive logical. Should unlisting be applied to list components of x?
use.names logical. Should names be preserved?
maximal If TRUE the maximal terms are returned, if FALSE the minimal terms are returned
index If TRUE the the index of the maximal/minimal elements of l are returned rather than the subset of maximal or minimal subset of l

Value

A vector or a logical.

Note

Use the xxxxPrim functions with caution!

Author(s)

Søren Højsgaard, sorenh@agrsci.dk

See Also

unique, setdiff, unlist

Examples

uniquePrim(c(1,2,3,2,1,2))
setdiffPrim(c(1,3,2), c(2,3,4,5))
unlistPrim(list(c(1,2),c(2,3)))
subsetof(c(1,2),c(1,2,3))
subsetof(c(1,2,3), c(1,2))

l <- list(c(1,2),c(1,2,3),c(2,4),c(5,6), 5)

subsetofList(c(1,2), l)
subsetofList(c(1,2,3,4), l)

removeRedundant(l)
removeRedundant(l, maximal=FALSE)

[Package gRbase version 1.0.1 Index]