I'm trying to decompose a square matrix with the R package irlba
but am getting the following message:
"Error in V[, 1:(k + dim(F)[2])] <- cbind(V[, 1:(dim(Bsvd$v)[1]), drop = FALSE] %*% : number of items to replace is not a multiple of replacement length"
Decomposing the matrix with svd
or eigen
work, however. I found this post elsewhere alluding to the same problem (without a response).
I would be grateful to anyone that can help me figure this out!
Code:
library(irlba)
C.i <- structure(c(0.107821513562202, 0.0629415996952743, -0.0346069282137902,
-0.0410208578535759, 0.0629415996952743, 0.136205395050303, -0.00378166611862939,
0.00237156895349009, -0.0346069282137902, -0.00378166611862939,
0.0122114763151942, -0.00635448918784993, -0.0410208578535759,
0.00237156895349009, -0.00635448918784993, 0.0431193044924), .Dim = c(4L, 4L),
.Dimnames = list(c("Sepal.Length", "Sepal.Width", "Petal.Length",
"Petal.Width"), c("Sepal.Length", "Sepal.Width", "Petal.Length",
"Petal.Width")))
irlba(C.i, nu=1, nv=1)
# These work
svd(C.i)
eigen(C.i)