rowSumsCrossprod: Apply crossprod and rowSums

Description Usage Arguments Value Author(s) Examples

View source: R/RcppExports.R

Description

Fast computation of crossprod(rowSums(X),Y)

Usage

1
rowSumsCrossprod(X, Y, transposeY)

Arguments

X

A matrix with dimensions n*k. Hence the result of rowSums(X) has length n.

Y

A matrix with dimenions n*m. Can be a matrix with dimension m*n but then transposeY should be TRUE.

transposeY

Logical. If TRUE transpose Y before matrix multiplication.

Value

A vector of length m.

Author(s)

Thomas Alexander Gerds <[email protected]>

Examples

1
2
3
4
5
6
7
x <- matrix(1:10,nrow=5)
y <- matrix(1:20,ncol=4)
rowSumsCrossprod(x,y,0)

x <- matrix(1:10,nrow=5)
y <- matrix(1:20,ncol=5)
rowSumsCrossprod(x,y,1)

riskRegression documentation built on April 19, 2018, 5:04 p.m.