Nothing
#'perm_mat()
#'
#'This function permutes the columns of a given matrix with a cyclic permutaion
#'
#' @param a A matrix
#' @param v The length of the cyclic permutation
#'
#' @return A matrix permuted cyclically by \code{v} columns
#'
#' @examples
#' perm_mat(a=diag(1,5),4)
#' @export
perm_mat <- function(a, v) {
if (is.vector(a)) {
return(perm_vec(a, v))
}
v <- c(v, rep(0, length(dim(a)) - length(v)))
f <- function(i) {
perm_vec(seq_len(dim(a)[i]), v[i])
}
do.call("[", c(list(a), sapply(seq_along(dim(
a
)), f, simplify = FALSE),
drop = FALSE))
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.