The function 1) identifies when genotypes first have non-zero populations; 2) copies all the rows of data for these time points; 3) modifies the copied rows by decreasing Generation and setting Population of the emerging genotypes to be close to zero; and then 4) adds the modified rows to the dataframe. This ensures that ggplot plots genotypes arising at the correct time points.
add_start_points(pop_df, start_positions = 0.5)
Dataframe with column names "Identity", "Population", and either "Generation" or "Time"
Numeric value between 0 and 1 that determines the times at which genotypes are assumed to have arisen (see examples)
By default, the function assumes that each genotype arose half way between the latest time at which its population is zero and the earliest time at which its population is greater than zero. You can override this assumption using the start_positions parameter. If start_positions = 0 (respetively 1) then each genotype is assumed to have arisen at the earliest (respectively latest) time compatible with the data. Intermediate values are also permitted.
The input Dataframe with additional rows.
Rob Noble, firstname.lastname@example.org
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.