inst/examples/four_minutes/plot_model.R

library(ggplot2)

plot_model <- function(model, data) {
  ggplot(data) +
    geom_point(aes(x = Temp, y = Ozone)) +
    geom_abline(intercept = model[1], slope = model[2]) +
    theme_gray(24)
}

dat <- read.csv("data/data.csv")
coefs <- scan("output/coefs.dat", quiet=TRUE)

p <- plot_model(coefs, dat)
ggsave("output/plot.pdf", p)

Try the makeit package in your browser

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

makeit documentation built on April 11, 2025, 5:38 p.m.