R/examples/ex-stat_reg_gof2.R

library(ggplot2)
library(data.table)

dates <- seq(as.Date("2010-01-01"), length.out = 32, by = "day")
dat <- data.table(mtcars) %>% cbind(date = dates, .)
dat$cyl <- as.factor(dat$cyl)
# table(dat$cyl)

ggplot(dat, aes(date, mpg, color = cyl)) +
  stat_gof2(aes(obs = mpg, sim = wt), x = 0, y = 1) +
  geom_point() +
  facet_wrap(~cyl)

## Example 2
dat = GPP_US_MMS
ggplot(dat, aes(date, GPP)) +
  geom_line() +
  stat_gof2(aes(obs=GPP, sim=SM),x = 0, y = 1)
rpkgs/gg.layers documentation built on Sept. 14, 2024, 11:07 p.m.