# Random data
M <- matrix(rnorm(200), nrow = 10)
# .. with dimnames
dimnames(M) <- list(LETTERS[1:10], as.character(1:20))
# A named list for indexing
inds <- list(B1 = 1:10, B2 = 11:20)
X <- block.data.frame(M, inds)
str(X)
Run the code above in your browser using DataLab