R/gg_histogram.R

Defines functions gg_histogram

Documented in gg_histogram

#' @title histogram
#' @param df dataframe
#' @param x x variable
#' @return ggplot object
#' @rdname gg_histogram
#' @export 
gg_histogram <- function(df, x){
  # needed? (created for use with ally but did not work...)
  x <- enexpr(x)
  
  p <- rlang::quo(
    ggplot(data=df, aes(x=!!x)) + 
      geom_histogram()
  )
  
  return(eval_tidy(p))
}
AstraZeneca/pmxplore documentation built on May 28, 2019, 11:04 a.m.