Is is possible to convert an bigstatsr::FBM
object to a regular R matrix?
For example, suppose that I generate the following matrix:
N <- 100
K <- 50
`%dopar%` <- foreach::`%dopar%`
`%:%` <- foreach::`%:%`
mat3 <- bigstatsr::FBM(N, K)
cl <- parallel::makeCluster(2)
doParallel::registerDoParallel(cl)
tmp3 <- foreach::foreach(j = 1:K, .combine = 'c') %:%
foreach::foreach(i = 1:N, .combine = 'c') %dopar% {
mat3[i, j] <- i + j
NULL
}
parallel::stopCluster(cl)
I want to convertmat3
to a regular R matrix object. I tried the following but it did not work
A <- as.matrix(mat3)
Error in as.vector(x, mode) :
cannot coerce type 'environment' to vector of type 'any'