inst/examples/datasaurus_dozen.R

if(require(ggplot2)){
  ggplot(datasaurus_dozen, aes(x=x, y=y, colour=dataset))+
    geom_point()+
    theme_void()+
    theme(legend.position = "none")+
    facet_wrap(~dataset, ncol=3)
}

# Base R plots
state <- par("mar", "mfrow")

# plot
par(mfrow = c(5, 3), mar=c(1, 2, 2, 1))

sets = sort(unique(datasaurus_dozen$dataset))

for (s in sets) {
  df <- datasaurus_dozen[datasaurus_dozen$dataset == s, ]
  plot(df$x, df$y, pch = 16)
  title(s)
}

#reset settings
par(state)
stephlocke/datasauRus documentation built on Oct. 27, 2018, 11:09 p.m.