R 如何制作分块矩阵?
假设我有下面的矩阵R 如何制作分块矩阵?,r,dataframe,matrix,R,Dataframe,Matrix,假设我有下面的矩阵 1 2 3 4 5 6 7 8 9 我想制作一个块矩阵,如: 1 2 3 0 0 0 0 0 0 0 0 0 4 5 6 0 0 0 0 0 0 0 0 0 7 8 9 0 0 0 0 0 0 0 0
1 2 3
4 5 6
7 8 9
我想制作一个块矩阵,如:
1 2 3 0 0 0 0 0 0 0 0 0
4 5 6 0 0 0 0 0 0 0 0 0
7 8 9 0 0 0 0 0 0 0 0 0
0 0 0 1 2 3 0 0 0 0 0 0
0 0 0 4 5 6 0 0 0 0 0 0
0. 0 0 7 8 9 0 0 0 0 0 0
0 0 0 0 0 0 1 2 3 0 0 0
0 0 0 0 0 0 4 5 6 0 0 0
0 0 0 0 0 0 7 8 9 0 0 0
0 0 0 0 0 0 0 0 0 1 2 3
0 0 0 0 0 0 0 0 0 4 5 6
0 0 0 0 0 0 0. 0 0 7 8 9
我做了以下工作:
BigKernel<-Matrix::bdiag(replicate(4, m1, simplify = FALSE))
这是错误的。而类型(Bigkernel)是S4
如何生成矩阵?
R
区分大小写BigKernel
和BigKernel
是不同的
as.matrix(BigKernel)
应该工作
R
区分大小写BigKernel
和BigKernel
是不同的
as.matrix(BigKernel)
应该有用