Nothing
#' Create Indicator Matrix
#'
#' Create an indicator matrix.
#'
#' @param grp A grouping vector.
#' @keywords utility
#' @export create.ind
create.ind <- function(grp) {
K <- length(unique(grp))
n <- length(grp)
mat <- matrix(0, nrow = n, ncol = K)
out <- apply(rbind(1:K, mat), 2, function(x, a) x[-1] + (a == x[1]), a = grp)
out
}
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.