Matthew Kay 2023-04-21
library(ggplot2)
library(dplyr)
library(distributional)
library(ggdist) # requires remotes::install_github("mjskay/ggdist@dev")Simple example of pattern matching and rewriting of expressions in R with a bquote()-style syntax.
N.B. doesn't support splicing-style syntax (..()), but shouldn't be too hard to add.
match_exprs = function(expr, ...) {
patterns = list(...)
for (pattern in patterns) {
tryCatch({
match = match_expr(expr, pattern[[2]])library(brms)
library(tidybayes)
library(dplyr)
library(ggplot2)
library(modelr)
mtcars_clean = mtcars %>%
mutate(cyl = ordered(cyl))| library(tidyverse) | |
| library(gganimate) | |
| library(tidybayes) # need latest vesion from github for geom_dotsh() | |
| k = 50 | |
| draws = tibble( | |
| x = qnorm(ppoints(k)), | |
| draw = sample(1:k, k) | |
| ) |