R/scatter.R

Defines functions scatter

Documented in scatter

#' Title
#'
#' @param df Default dataset to use for plot.
#' @param y Values scattered on y-axis and on left-hand side of regression formula.
#' @param x Values scattered on x-axis and on right-hand side of regression formula.
#'
#' @return A `ggplot2` object
#' @export
#'
#' @import ggplot2
#' @examples
#' scatter(mtcars, hp, mpg)
scatter <- function(df, y, x) {
	ggplot(df) +
		aes(x = {{ x }}, y = {{ y }}) +
		geom_point() +
		geom_lm()
}
ldimartin0/ladtools documentation built on June 8, 2022, 3:30 p.m.