Skip to content

Commit 4413d6b

Browse files
committed
#62 ensure outputs with cli messages are colourised
See: - quarto-dev/quarto-cli#13815
1 parent 5b72855 commit 4413d6b

1 file changed

Lines changed: 37 additions & 2 deletions

File tree

inst/ISC_blog.qmd

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,39 @@ author:
1717
orcid: 0000-0002-6585-538X
1818
---
1919

20+
```{r}
21+
#| label: setup
22+
#| include: false
23+
#| echo: false
24+
knitr::opts_chunk$set(
25+
comment = "#>"
26+
)
27+
# enable coloured cli text in output chunks
28+
options(crayon.enabled = TRUE,
29+
cli.num_colors = 256)
30+
fansi::set_knit_hooks(knitr::knit_hooks, which = c("output", "message", "error"))
31+
```
32+
33+
```{=html}
34+
<style>
35+
/* 1) Collapse spacing on the <pre> blocks produced by fansi */
36+
pre.fansi {
37+
margin: 0 !important;
38+
}
39+
40+
/* Optional: if you still see gaps, also collapse adjacent fansi blocks */
41+
pre.fansi + pre.fansi {
42+
margin-top: 0 !important;
43+
}
44+
45+
/* 2) remove the default margin that Quarto adds around output code blocks */
46+
.cell pre {
47+
margin-top: 0 !important;
48+
margin-bottom: 0 !important;
49+
}
50+
</style>
51+
```
52+
2053
Expert judgements and forecasts are playing an increasingly important role in a variety of fields such as ecological management and decision making [@Legge2022], biosecurity risk analyses [@Wittmann2015], replicability forecasts [@Mody2026], and horizon scanning exercises [@Sutherland2017]. Eliciting judgements from multiple experts is always preferable to relying on single estimates, but it comes with the challenge of aggregating different opinions. Achieving *behavioural consensus* amongst a group of experts, i.e. continued deliberation until everyone agrees on the same answer, is difficult, time consuming, and not always appropriate when multiple, valid viewpoints exist. The alternative is to make use of *mathematical consensus*, whereby data from a group of experts is mathematically aggregated into a single score.
2154

2255
Aggregated elicited judgements form a critical component of decision-making across multiple contexts, but there has been a dearth of accessible tools for implementing anything more complex than linear averages. Existing software options are either closed-source, locked behind paid software licenses, non-reproducible, or written in programming languages scantly used by ecologists or metascientists. Methods implemented in R, one of the most widely used programming languages in the life sciences [@Gao2025], are also limited, either being small in scope or having been archived from CRAN over the years.
@@ -31,13 +64,15 @@ Aggregated elicited judgements form a critical component of decision-making acro
3164

3265
# Using {aggreCAT}
3366

34-
{aggreCAT} v1.0.0 is available on [CRAN](https://cran.r-project.org/package=aggreCAT) while a development version is maintained on [GitHub (metamelb-repliCATS/aggreCAT)](https://github.com/metamelb-repliCATS/aggreCAT). For the walkthrough below we make use of the {aggreCAT}’s inbuilt datasets, which were originally published in Wintle et al. (2023) -@Wintle2023. This study served as a pilot of the repliCATS approach to the SCORE program and consists of evaluations by 25 experts of 25 published papers that underwent attempted replication.
67+
{aggreCAT} v1.0.0 is available on [CRAN](https://cran.r-project.org/package=aggreCAT) while a development version is maintained on [GitHub (metamelb-repliCATS/aggreCAT)](https://github.com/metamelb-repliCATS/aggreCAT). For the walkthrough below we make use of the {aggreCAT}’s inbuilt datasets, which were originally published in Wintle et al. (2023) [-@Wintle2023]. This study served as a pilot of the repliCATS approach to the SCORE program and consists of evaluations by 25 experts of 25 published papers that underwent attempted replication.
3568

3669
## Load Packages
3770

3871
```{r}
3972
#| label: load-libs
40-
#| echo: false
73+
#| message: false
74+
#| warning: false
75+
#| echo: true
4176
library(aggreCAT)
4277
library(tidyverse)
4378
```

0 commit comments

Comments
 (0)