212
212
sum(x$v) / prod(dim(x))
215
aperm.simple_sparse_array <-
216
function(a, perm = NULL, ...)
218
s <- seq_along(a$dim)
222
perm <- if(is.character(perm))
223
match(perm, names(a$dimnames))
224
else if(is.numeric(perm))
227
if(length(perm) != length(s) || any(is.na(perm)))
228
stop("Invalid permutation.")
230
simple_sparse_array(a$i[, perm, drop = FALSE], a$v,
231
a$dim[perm], a$dimnames[perm])