filter_by_generation_or_numcells: Filter a data frame by Generation or NumCells

Description Usage Arguments Details Value Examples

View source: R/datacollation.R

Description

Filter a data frame by Generation or NumCells

Usage

1
2
filter_by_generation_or_numcells(df, path, generation = NA,
  numcells = NA, num_parameters = NA)

Arguments

df

data frame

path

folder containing output.dat (needed for numcells only)

generation

Generation at which to filter (default NA corresponds to no filtering)

numcells

Number of cells at which to filter (default NA corresponds to no filtering)

num_parameters

Number of parameters, accounting for the first set of columns in the dataframe; required if df represents multiple simulations

Details

If both generation and numcells are provided then numcells takes precedent. If numcells is provided and df lacks a NumCells column then a NumCells column will be added (using the output.dat file in the folder specified by path), unless df contains multiple seed values, in which case an error will result.

Value

the combined dataframe

Examples

1
2
3
4
5
df <- read_delim_special(system.file("extdata", "output_allele_counts.dat", 
package = "demonanalysis", mustWork = TRUE))
filter_by_generation_or_numcells(df, NA, generation = 10, numcells = NA)
my_path <- system.file("extdata", package = "demonanalysis", mustWork = TRUE)
filter_by_generation_or_numcells(df, my_path, generation = NA, numcells = 100)

robjohnnoble/demonanalysis documentation built on June 30, 2020, 12:47 a.m.