R/plot_sequence_counts.R

#' To plot sequence counts over time
#' @param data A data frame of sequence counts over time, as generated by simulate_bursts
#' @param plot_title What to call the plot
#' @return The figure to be plotted
#' @importFrom magrittr "%>%"
#' @export

plot_sequence_counts <- function(data, plot_title)
{
  data <- data %>%
    tidyr::gather(key="sequence_index", value="count", -time)

  p <- ggplot2::ggplot(data = data,
              ggplot2::aes(x=time, y=count, colour=sequence_index))
  p <- p + ggplot2::geom_step()
  p <- p + ggplot2::labs(x = "number of time steps", y = "Number of copies", title = plot_title)
  return(p)
}
sams25/rcombinator_old documentation built on May 28, 2019, 8:40 a.m.