R/lower.R

Defines functions lower

Documented in lower

lower <- function(m)
{
# Takes the lower triangle of a matrix
# Does NOT check for symmetric matrix

m <- as.matrix(m)

if(ncol(m) != nrow(m))
    stop("Matrix not square.")
if(ncol(m) == 1) {
   warning("Matrix is 1x1.")
   m
}
else 
    m[col(m) < row(m)]
}

Try the ecodist package in your browser

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

ecodist documentation built on Nov. 2, 2023, 6:01 p.m.