Description Usage Arguments Value Examples
View source: R/datacollation.R
Add derived variables to a dataframe
1 | add_columns(df, num_parameters)
|
df |
dataframe with columns including "Generation" and "NumCells" |
num_parameters |
number of parameters, accounting for the first set of columns in the dataframe |
The same dataframe with additional columns. For each simulation, "JustBeforeTTT" and "JustAfterTTT" are binary indicators for treated tumours; "maxgen" is the maximum value of Generation; "gen_adj" is the time elapsed since Generation zero, relative to maxgen; SmoothNumCells is NumCells with loess smoothing; SmoothRadius is the radius of a disc of area NumCells, after loess smoothing; GrowthRate and RadiusGrowthRate are the rates of change of SmoothNumCells and SmoothRadius, relative to Generation. Deal differently with dataframe containing the column "Treated".
1 2 3 | df <- data.frame(p = 1, seed = rep(1:2, each = 10),
Generation = c(1:10, 3:12), NumCells = rep(1:10, times = 2) + rnorm(20, 0, 0.1))
add_columns(df, 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.