View source: R/MultiLambdaCVfun.R
augment | R Documentation |
This function augments data with zeros to allow pairing of data on the same variables, but from DIFFERENT samples
augment(Xdata1, Xdata2)
Xdata1 |
Data frame or data matrix of dimension |
Xdata2 |
Data frame or data matrix of dimension |
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.
List
Xaug1 |
Augmented data matrix 1 |
Xaug2 |
Augmented data matrix 2 |
#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]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.