I have a data set with 9200 rows and 6 columns. I found the kernel of this data frame with the following code:
#kernel
library("kernlab", "v0.9-27")
D<-as.matrix(X1)
rbf <- rbfdot(sigma = 0.05)
kernel<-kernelMatrix(rbf, D)
Now I want to put this as a diagonal of a square matrix. for example suppose kernel matrix is
K11 k12
k21 k22
I need a matrix like
K11 k12 0 0 0 0 0 0
k21 k22 0 0 0 0 0 0
0 0 K11 k12 0 0 0 0
0 0 k21 k22 0 0 0 0
0 0 0 0 K11 k12 0 0
0 0 0 0 K21 k22 0 0
0 0 0 0 0 0 K11 k12
0 0 0 0 0 0 K21 k22