The qg2 function allows quickly drawing plots from different types of objects. If you want to reproduce these but have more control on the chart (color, etc.) then please see the recipes vignette vignettes.

Dot and whisker

m1 <- lm(mpg ~ wt + cyl + disp + gear, data = mtcars)

qg2(m1)
m2 <- update(m1, . ~ . + hp)
m3 <- update(m2, . ~ . + am) 

qg2(list(m1, m2, m3))

Survival

library(survival)

fit <- survfit(Surv(time, status) ~ trt, data = survival::veteran)

qg2(fit)

Acf

cc <- acf(lh, plot = FALSE)

qg2(cc)

Xts

library(quantmod)

aapl <- getSymbols("AAPL", env = NULL)

aapl %>% 
  head(50) %>% 
  qg2()
rate <- getFX("EUR/CHF", auto.assign = FALSE)

qg2(rate)

stl

s <- stl(nottem, "per")

qg2(s)

Roc curve

library(yardstick)
#> For binary classification, the first factor level is assumed to be the event.
#> Use the argument `event_level = "second"` to alter this as needed.

data(two_class_example)

roc <- roc_curve(two_class_example, truth, Class1)

qg2(roc)
data(hpc_cv)

hpc_cv %>%
  dplyr::group_by(Resample) %>%
  roc_curve(obs, VF:L) %>% 
  qg2()

Forecast

library(forecast)

fc <- forecast(ets(USAccDeaths))

qg2(fc)

Matrices

correl_mat <- cor(mtcars)

qg2(correl_mat) %>% 
  gauge_color(c("#c77dff", "#7b2cbf", "#240046"))

Confusion Matrix

library(yardstick)

data(hpc_cv)

cm <- hpc_cv %>%
  dplyr::filter(Resample == "Fold01") %>%
  conf_mat(obs, pred)

qg2(cm)

igraph

g <- igraph::erdos.renyi.game(500, 2/500)

qg2(g)

PCA

pca <- prcomp(mtcars[,c(1:7,10,11)], center = TRUE,scale. = TRUE)

qg2(pca)

Explore recipes