augment: Augment data with zeros.

View source: R/MultiLambdaCVfun.R

augmentR Documentation

Augment data with zeros.

Description

This function augments data with zeros to allow pairing of data on the same variables, but from DIFFERENT samples

Usage

augment(Xdata1, Xdata2)

Arguments

Xdata1

Data frame or data matrix of dimension n_1 x p.

Xdata2

Data frame or data matrix of dimension n_2 x p

Details

Xdata1 and Xdata2 should have the same number of columns. These columns represent variables. Augments both data matrices with zeros, such that the matrices can be paired using createXXblocks on the output of this function.

Value

List

Xaug1

Augmented data matrix 1

Xaug2

Augmented data matrix 2

Examples

#Example
#Simulate
n1 <- 10
n2 <- 20
p <- 100
X1 <- matrix(rnorm(p*n1),nrow=n1)
X2 <- matrix(rnorm(p*n2),nrow=n2)

#check whether column dimension is correct
ncol(X1)==ncol(X2)

#create cross-product
Xaugm <- augment(X1,X2)

#check dimensions (should be (n1+n2) x p)
dim(Xaugm[[1]])
dim(Xaugm[[2]])

multiridge documentation built on June 13, 2022, 5:07 p.m.