-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
104 lines (77 loc) · 3.81 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit the .rmd file and then use devtools::build_readme() to update the md file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# elicitr <a href="#"><img src="man/figures/logo.png" height="138" align="right">
<!-- badges: start -->
[![Project Status](https://www.repostatus.org/badges/latest/concept.svg)](https://www.repostatus.org/#concept)
[![R-CMD-check](https://github.com/CREWdecisions/elicitr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/CREWdecisions/elicitr/actions/workflows/R-CMD-check.yaml)
[![lint](https://github.com/CREWdecisions/elicitr/actions/workflows/lint.yaml/badge.svg)](https://github.com/CREWdecisions/elicitr/actions/workflows/lint.yaml)
[![Codecov test coverage](https://codecov.io/gh/CREWdecisions/elicitr/graph/badge.svg)](https://app.codecov.io/gh/CREWdecisions/elicitr)
<!-- badges: end -->
## Description
elicitr is an R package used to standardise, visualise and aggregate data from expert elicitation.\
The package is in active development and will implement functions based on two formal elicitation methods:
* Elicitation of continuous variables\
Adapted from Hemming, V. et al. (2018). A practical guide to structured expert elicitation using the IDEA protocol. Methods in Ecology and Evolution, 9(1), 169–180. https://doi.org/10.1111/2041-210X.12857
* Elicitation of categorical data\
Adapted from Vernet, M. et al. (2024). Assessing invasion risks using EICAT-based expert elicitation: application to a conservation translocation. Biological Invasions, 26(8), 2707–2721. https://doi.org/10.1007/s10530-024-03341-2
## Installation
You can install the development version of elicitr from GitHub with:
```r
# install.packages("pak")
pak::pak("CREWdecisions/elicitr")
```
## How elicitr works
Just as one creates a form to collect estimates in an elicitation process, with elicitr one creates an object to store metadata information. This allows to check whether experts have given their answers in the expected way.\
All the functions in the elicitr package start with two prefixes: `cont` and `cat`. This design choice is intended to enhance functions discovery. `cont` functions are used for the elicitation of continuous variables while `cat` functions for the elicitation of categorical variables.
## Getting started
```{r setup}
library(elicitr)
```
Create the metadata object and load the data for continuous variables:
```{r load-data}
my_elicitation <- cont_start(var_names = c("var1", "var2", "var3"),
var_types = "ZNp",
elic_types = "134",
experts = 6) |>
cont_add_data(data_source = round_1, round = 1) |>
cont_add_data(data_source = round_2, round = 2)
my_elicitation
```
Plot raw data for variable 2 in round 1:
```{r plot-raw-data}
plot(my_elicitation, round = 1, var = "var2")
```
Data can be sampled from the elicitation object:
```{r}
samp <- cont_sample_data(my_elicitation, round = 2)
samp
```
And the sample summarised:
```{r sample-summary}
summary(samp)
```
And plotted as violin plots:
```{r sample-plot-violin}
#| fig.alt: >
#| Violin plot of the sampled data for variable 2.
plot(samp, var = "var2", type = "violin")
```
Or plotted as density plots:
```{r sample-plot-density}
#| fig.alt: >
#| Density plot of the sampled data for variable 3.
plot(samp, var = "var3", type = "density")
```
## Similar packages
* {shelf} : Oakley, J. (2024). Package “SHELF” Tools to Support the Sheffield Elicitation Framework. https://doi.org/10.32614/CRAN.package.SHELF
* {prefR} : Lepird, J. (2022). Package “prefeR” R Package for Pairwise Preference Elicitation. https://doi.org/10.32614/CRAN.package.prefeR