Skip to contents

Point plot (scatter-plot)

Usage

gg_scatter(df, x_var, y_var, ...)

Arguments

df

input dataset (tibble or data.frame)

x_var

x variable (supplied to ggplot2::aes(x = ))

y_var

y variable (supplied to ggplot2::aes(y = ))

...

other arguments passed to ggplot2::geom_point(), outside of ggplot2::aes()

Value

A ggplot2 plot object

Examples

diamonds <- ggplot2::diamonds
mini_dmnds <- diamonds[sample(nrow(diamonds), 10000), ]
gg_scatter(
  df = mini_dmnds,
  x_var = "carat",
  y_var = "price",
  alpha = 1 / 3,
  color = "#000000",
  size = 2
)