add_relative_time: Add relative time column to a dataframe, and diversity at the...

Description Usage Arguments Value Examples

View source: R/datacollation.R

Description

Add relative time column to a dataframe, and diversity at the new time zero

Usage

1
add_relative_time(df, start_size, num_parameters)

Arguments

df

dataframe with columns including "Generation", "NumCells" and "DriverEdgeDiversity"

start_size

value of NumCells at which new_time should be set to zero

num_parameters

number of parameters, accounting for the first set of columns in the dataframe

Value

the same dataframe with additional columns: "new_time" is the time elapsed since NumCells = start_size; "div0" is DriverDiversity when NumCells = start_size; "rank_div0" is div0 rescaled to a rank between 0 and 1

Examples

1
2
3
4
num_parameters = count_parameters(system.file("extdata", "", 
package = "demonanalysis", mustWork = TRUE))
comb_df <- combine_dfs(system.file("extdata", "", package = "demonanalysis", mustWork = TRUE))
add_relative_time(comb_df, start_size = 100, num_parameters = num_parameters)

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