library(brms)
library(tidybayes)
library(dplyr)
library(ggplot2)
library(modelr)
mtcars_clean = mtcars %>%
mutate(cyl = ordered(cyl))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | |
| ) |
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]])