colMedians: Column medians

Description Usage Arguments Examples

View source: R/colMedians.R

Description

Function to calculate the column-wise medians of a matrix of data frame (like a somewhat-simplified median analog to colMeans). Useful for calculating posterior medians in Bayesian statistics.

Usage

1
colMedians(colMedians.object, na.rm = FALSE)

Arguments

colMedians.object

Object for which we wish to calculate column medians

na.rm

Should NAs be excluded? Defaults to FALSE

Examples

1
2
3
4
5
6
## Compute medians for a matrix
my.matrix = matrix(1:15,3,5)
colMedians(my.matrix)
## Computer medians for a data frame
my.df = as.data.frame(my.matrix)
colMedians(my.df)

lcomm/ltools documentation built on May 20, 2019, 11:28 p.m.