m <- simulate_sparse_matrix(
1000, 1000,
decimal = 3
)
system.time(
a <- as.matrix(m)
)
system.time(
b <- as_matrix(m)
)
system.time(
c <- as_matrix(m, parallel = TRUE)
)
system.time(
d <- as_matrix(m, sparse = TRUE)
)
m[1:5, 1:5]
a[1:5, 1:5]
b[1:5, 1:5]
c[1:5, 1:5]
identical(a, b)
identical(a, c)
identical(b, c)
identical(a, d)
identical(b, d)
Run the code above in your browser using DataLab