Skip to content

Commit

Permalink
more ci fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mjskay committed Apr 24, 2024
1 parent a622457 commit 72a99e9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions vignettes/tidybayes.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ if (requireNamespace("pkgdown", quietly = TRUE) && pkgdown::in_pkgdown()) {
large_height = 5.25
}
eval_chunks = if (isTRUE(exists("params"))) params$EVAL else FALSE
knitr::opts_chunk$set(
fig.width = small_width,
fig.height = small_height,
eval = if (isTRUE(exists("params"))) params$EVAL else FALSE
eval = eval_chunks
)
if (capabilities("cairo") && Sys.info()[['sysname']] != "Darwin") {
knitr::opts_chunk$set(
Expand Down Expand Up @@ -104,7 +105,6 @@ library(ggdist)
library(tidybayes)
library(ggplot2)
library(cowplot)
library(emmeans)
library(broom)
library(rstan)
library(rstanarm)
Expand Down Expand Up @@ -643,9 +643,9 @@ m_linear = lm(response ~ condition, data = ABC)

Combining `emmeans::emmeans` with `broom::tidy`, we can generate tidy-format summaries of conditional means from the above model:

```{r, eval=requireNamespace("emmeans", quietly = TRUE)}
```{r, eval = eval_chunks && requireNamespace("emmeans", quietly = TRUE)}
linear_results = m_linear %>%
emmeans::emmeans(~ condition) %>%
emmeans::emmeans(~ condition) %>%
tidy(conf.int = TRUE) %>%
mutate(model = "OLS")
Expand Down Expand Up @@ -733,7 +733,7 @@ m_rst = stan_glm(response ~ condition, data = ABC)

We can use `emmeans::emmeans()` to get conditional means with uncertainty:

```{r, eval=requireNamespace("emmeans", quietly = TRUE)}
```{r, eval = eval_chunks && requireNamespace("emmeans", quietly = TRUE)}
m_rst %>%
emmeans::emmeans( ~ condition) %>%
gather_emmeans_draws() %>%
Expand All @@ -742,7 +742,7 @@ m_rst %>%

Or `emmeans::emmeans()` with `emmeans::contrast()` to do all pairwise comparisons:

```{r, eval=requireNamespace("emmeans", quietly = TRUE)}
```{r, eval = eval_chunks && requireNamespace("emmeans", quietly = TRUE)}
m_rst %>%
emmeans::emmeans( ~ condition) %>%
emmeans::contrast(method = "pairwise") %>%
Expand All @@ -754,7 +754,7 @@ See the documentation for `emmeans::pairwise.emmc()` for a list of the numerous

As before, we can plot the results instead of using a table:

```{r fig.width = tiny_width, fig.height = tiny_height, eval=requireNamespace("emmeans", quietly = TRUE)}
```{r fig.width = tiny_width, fig.height = tiny_height, eval = eval_chunks && requireNamespace("emmeans", quietly = TRUE)}
m_rst %>%
emmeans::emmeans( ~ condition) %>%
emmeans::contrast(method = "pairwise") %>%
Expand All @@ -765,7 +765,7 @@ m_rst %>%

`gather_emmeans_draws()` also supports `emm_list` objects, which contain estimates from different reference grids (see `emmeans::ref_grid()` for more information on reference grids). An additional column with the default name of `.grid` is added to indicate the reference grid for each row in the output:

```{r, eval=requireNamespace("emmeans", quietly = TRUE)}
```{r, eval = eval_chunks && requireNamespace("emmeans", quietly = TRUE)}
m_rst %>%
emmeans::emmeans(pairwise ~ condition) %>%
gather_emmeans_draws() %>%
Expand Down

0 comments on commit 72a99e9

Please sign in to comment.