inst/examples/prg1.R

#' Setup

library(dplyr)
library(ggplot2)

#' Prepare data

x <- mtcars |>
  as_tibble(rownames = "car")

print(x)

#' Create and save plot

ggplot(data = x) +
  geom_point(mapping = aes(x = mpg, y = hp, size = wt, colour = as.factor(am)))

ggsave("plot1.png")

Try the whirl package in your browser

Any scripts or data that you put into this service are public.

whirl documentation built on April 16, 2025, 1:11 a.m.