gRbase-utilities: Utility functions for gRbase

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

Description

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

Usage

1
2
3
4

Arguments

x, y

Vectors

l

A list (of vectors)

Details

colwiseProd multiplies a vector and a matrix columnwise (as opposed to rowwise which is achieved by v*M). Hence colwiseProd does the same as t(v*t(M)) - but it does so faster for numeric values.

Value

A vector or a logical.

Note

Use the xxxxPrim functions with caution!

Author(s)

S<f8>ren H<f8>jsgaard, sorenh@math.aau.dk

See Also

unique, setdiff, unlist

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)))

## colwiseProd
M <- matrix(1:16, nrow=4)
v <- 1:4

t(v*t(M))
colwiseProd(v,M)

system.time(for (ii in 1:100000)  t(v*t(M)))
system.time(for (ii in 1:100000)  colwiseProd(v,M))

gRbase documentation built on May 2, 2019, 4:51 p.m.