How can I create a 3D array with multiple data frames (or, I can convert them to arrays if that makes more sense) as the third dimension? So, I have multiple data frames that have rows and columns (are 2D), and I want them in one 3D array. The columns are the same across all data frames, but the number of rows is variable.
a <- c(1, 2)
b <- c(2, 1)
df <- data.frame(a, b)
c <- c(3, 4)
d <- c(4, 3)
df2 <- data.frame(c, d)
I need df
and df2
to be the third dimension in an array