Take lists and convert them to data frame

lists_to_data(Y, X)

Arguments

Y

list of response vectors

X

list of predictor matrices

Value

A data frame with all the X variables, as well as the Y variable and a new column identifying the class.

Examples

p = 7
k = 2
n = 20
beta = c(1,2)
set.seed(1)
X = list(matrix(rnorm(p*n), ncol = p), matrix(rnorm(p*n), ncol = p))
Y = list(rnorm(n), rnorm(n))
df = lists_to_data(Y, X)
lst = data_to_lists(df)