augment: Augment data with zeros.

Description Usage Arguments Details Value Examples

View source: R/MultiLambdaCVfun.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#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 15, 2021, 9:08 a.m.