library(ggplot2)
library(dplyr)
data("diamonds")
draw_points <- function(dat, var) {
mycall <- match.call()
colnames(dat)[colnames(dat) == var] <- "var"
ggplot(dat, aes(x = cut, y = var)) +
ylab(var) +
geom_point()
}
draw_points(diamonds, var="color")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.