summarize.endpoint: Take population average of single-cell traits

Description Usage Arguments Details Value Examples

View source: R/EndpointSummaryStats.R

Description

In most Pheno-Evo experiments you will want to store the values of traits, such as degrade rate, for every cell in the population at every timepoint; however, in many cases it can be helpful to analyze just the population means of those traits. This function calculates mean values of the traits you ask it to, and appends those means to your existing endpoint dataframe.

Usage

1
summarize.endpoint(ends.df, traitlist)

Arguments

ends.df

Dataframe of endpoint data, generated by extract.endpoint().

traitlist

A vector of the names of the variables for which means should be calculated; names should match the corresponding column names, and each should be enclosed in quotation marks.

Details

Dataframes from timepoints other than the endpoint are also fine, as long as there is only 1 row per run number.

Value

A new dataframe consisting of the original input dataframe with appended columns, one for each trait averaged.

Examples

1
2
3
4
data(PhenoEvoData_small)
PE.ends_small<-extract.endpoint(PhenoEvoData_small, c(2, 4, 6))
pop.level.traits<-c('degrade.rate','switch.rate','response.error','generation')
PE.ends_small<-summarize.endpoint(PE.ends_small, pop.level.traits)

jessicaaudreylee/PhenoEvoR documentation built on Sept. 7, 2020, 3:50 a.m.