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 c90ab9b commit a622457
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ jobs:
extra-packages: |
any::rcmdcheck
any::BH
emmeans=?ignore-before-r=4.1.0
estimability=?ignore-before-r=4.3.0
any::RcppEigen
emmeans=?ignore-before-r=4.3.0
needs: check

# - name: Install system dependencies
Expand Down
28 changes: 14 additions & 14 deletions vignettes/tidybayes.Rmd
Original file line number Diff line number Diff line change
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}
```{r, eval=requireNamespace("emmeans", quietly = TRUE)}
linear_results = m_linear %>%
emmeans(~ condition) %>%
emmeans::emmeans(~ condition) %>%
tidy(conf.int = TRUE) %>%
mutate(model = "OLS")
Expand Down Expand Up @@ -733,19 +733,19 @@ m_rst = stan_glm(response ~ condition, data = ABC)

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

```{r}
```{r, eval=requireNamespace("emmeans", quietly = TRUE)}
m_rst %>%
emmeans( ~ condition) %>%
emmeans::emmeans( ~ condition) %>%
gather_emmeans_draws() %>%
median_qi()
```

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

```{r}
```{r, eval=requireNamespace("emmeans", quietly = TRUE)}
m_rst %>%
emmeans( ~ condition) %>%
contrast(method = "pairwise") %>%
emmeans::emmeans( ~ condition) %>%
emmeans::contrast(method = "pairwise") %>%
gather_emmeans_draws() %>%
median_qi()
```
Expand All @@ -754,20 +754,20 @@ 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}
```{r fig.width = tiny_width, fig.height = tiny_height, eval=requireNamespace("emmeans", quietly = TRUE)}
m_rst %>%
emmeans( ~ condition) %>%
contrast(method = "pairwise") %>%
emmeans::emmeans( ~ condition) %>%
emmeans::contrast(method = "pairwise") %>%
gather_emmeans_draws() %>%
ggplot(aes(x = .value, y = contrast)) +
stat_halfeye()
```

`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}
```{r, eval=requireNamespace("emmeans", quietly = TRUE)}
m_rst %>%
emmeans(pairwise ~ condition) %>%
emmeans::emmeans(pairwise ~ condition) %>%
gather_emmeans_draws() %>%
median_qi()
```
Expand All @@ -789,8 +789,8 @@ Now we can use `emmeans()` and `gather_emmeans_draws()` exactly as we did with `

```r
m_glmm %>%
emmeans( ~ condition, data = ABC) %>%
contrast(method = "pairwise") %>%
emmeans::emmeans( ~ condition, data = ABC) %>%
emmeans::contrast(method = "pairwise") %>%
gather_emmeans_draws() %>%
ggplot(aes(x = .value, y = contrast)) +
stat_halfeye()
Expand Down

0 comments on commit a622457

Please sign in to comment.