R/plot_summary_stats.R

#' Plots summary statistics for distances between sequences
#' @param summary_table The data returned by a simulation
#' @importFrom magrittr "%>%"
#' @export
plot_summary_stats <- function(summary_table, timejump = 10^6)
{
  p <- ggplot2::ggplot(data = summary_table,
                       ggplot2::aes(x = time))
  p <- p + ggplot2::geom_line(ggplot2::aes(y = mean_dist, color = num_seq))
  p <- p + ggplot2::labs(x = paste0("time (in ", timejump, " years)"), y = "mean pairwise sequence distance",
                         title = "Mean pairwise distance over time")
  p <- p + ggplot2::guides(color=ggplot2::guide_legend(title="Number of sequences"))
  return(p)
}
sams25/rcombinator_old documentation built on May 28, 2019, 8:40 a.m.