median_by_factor: Create a data frame of the medians of rows by a given factor...

View source: R/expt.R

median_by_factorR Documentation

Create a data frame of the medians of rows by a given factor in the data.

Description

This assumes of course that (like expressionsets) there are separate columns for each replicate of the conditions. This will just iterate through the levels of a factor describing the columns, extract them, calculate the median, and add that as a new column in a separate data frame.

Usage

median_by_factor(data, fact = "condition", fun = "median")

Arguments

data

Data frame, presumably of counts.

fact

Factor describing the columns in the data.

fun

Optionally choose mean or another function.

Details

Used in write_expt() as well as a few random collaborations.

Value

Data frame of the medians.

See Also

[Biobase] [matrixStats]

Examples

## Not run: 
 compressed = median_by_factor(data, experiment$condition)

## End(Not run)

elsayed-lab/hpgltools documentation built on May 9, 2024, 5:02 a.m.