R/ISI-diffmat.R

Defines functions .diffmat

Documented in .diffmat

# isi 15_07_05

#' difference matrix
#'
#' difference matrix
#'
#' @param mat square interaction matrix with winner in rows and losers in columns, for example the output from \code{\link{creatematrix}}
#'
#' @return a matrix with ranking differences assuming that the matrix reflects the order. This information is contained in the upper triangle of the returned matrix.
#'
#' @author Christof Neumann
#'
#' @details helper function for \code{\link{ISI}}
#'
#' @examples
#' data(bonobos)
#' EloRating:::.diffmat(bonobos)
#'

.diffmat <- function(mat) {
  x <- ncol(mat)
  matrix(rep(0:x, x), ncol = x, byrow = TRUE)[1:x, ]
}

Try the EloRating package in your browser

Any scripts or data that you put into this service are public.

EloRating documentation built on March 26, 2020, 7:29 p.m.