R/plot_hatch.R

Defines functions plot_hatch

Documented in plot_hatch

#' plot_hatch
#'
#' Creating a ggplot with geom_bar.
#'
#' Meant to create a histogram of the hatch dates,
#' but simply creates a histogram with the ototools specific frame.
#'
#' @param values days of hatch
#' @param xlab titel of xaxis, default is Hatch_day
#' @export
#'
#' @examples
#' #rm(list = ls())
#' values <- basic$deathday - basic$age
#' plot_hatch(values = values)
#'

plot_hatch <- function(values, xlab = "") {
  p <- ggplot2::ggplot(data = NULL, ggplot2::aes(x = values)) +
    ggplot2::geom_bar() +
    ggplot2::geom_abline(intercept = 0, slope = 0) +
    ggplot2::xlab(xlab) +
    plot_outline()
  return(p)
}
reneplonus/ototools documentation built on May 3, 2019, 4:05 p.m.