Nothing
#' Row and Column Percentages
#'
#' Convenience wrappers around \code{\link{apply}()} to compute row and column
#' percentages of matrix-like structures, including output of
#' \code{\link{xtabs}}.
#'
#'
#' @aliases col.perc row.perc
#' @param x matrix-like structure
#' @author Randall Pruim
#' @keywords array
#' @export
#' @examples
#'
#' row.perc(tally(~ airline + result, data = AirlineArrival))
#' col.perc(tally(~ airline + result, data = AirlineArrival))
#'
col.perc <- function (x)
{
x/rep(apply(x, 2, sum), each = dim(x)[1])
}
#' @rdname col.perc
#' @export
row.perc <- function (x)
{
x/apply(x, 1, sum)
}
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.