generated from rstudio/bookdown-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.Rmd
74 lines (55 loc) · 5.51 KB
/
index.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
---
title: "The pavo handbook: studying biological colouration in R"
# author: "Yihui Xie"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
output: bookdown::gitbook
documentclass: book
bibliography: [book.bib, packages.bib]
css: "style.css"
biblio-style: apalike
link-citations: yes
github-repo: bisaloo/colsci-book
# description: "This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook."
---
```{r setup, echo = FALSE}
knitr::opts_chunk$set(
class.warning = "cw",
class.message = "cm",
fig.align = "center",
width = 68,
comment = "#>",
tidy = "styler"
)
options(
width = 68,
str = strOptions(strict.width = "cut")
)
```
[pavo_repo]: https://github.com/rmaia/pavo
[data_location]: https://github.com/rmaia/pavo/tree/master/data_external/vignette
```{r, echo = FALSE}
book_repo <- "https://github.com/Bisaloo/colsci-book"
book_site <- "https://bisaloo.github.io/colsci-book"
```
# Package Overview
`pavo` is an `R` package developed with the goal of establishing a flexible and integrated workflow for working with spectral and spatial colour data. It includes functions that take advantage of new data classes to work seamlessly from importing raw spectra and images, to visualisation and analysis. It provides flexible ways to input spectral data from a variety of equipment manufacturers, process these data, extract variables, and produce publication-quality figures.
`pavo` was written with the following workflow in mind:
1. **Organise** data by importing and processing spectral and image data (e.g., to remove noise, negative values, smooth curves, etc.).
2. **Analyse** the resulting files, using spectral analyses of shape (hue, saturation, brightness), visual models based on perceptual data, and/or spatial adjacency and boundary strength analyses.
3. **Visualise** the output, with multiple options provided for exploration and analysis.
```{r, echo = FALSE, fig.cap = "A non-exhaustive overview of the colour-pattern analysis workflow in pavo, as of version 2.0, displaying some key functions at each stage.", out.width = '100%', dpi = 72}
knitr::include_graphics(file.path(book_repo, "blob/main/fig/workflow.png?raw=TRUE"))
```
In the remaining chapters we begin by detailing the importing, processing and visualisation of spectral and image data, before moving on to discussion of the many analyses that `pavo` allows. Our hope is to demonstrate the flexibility of `pavo`, and to provide a cohesive, reproducible workflow for colour pattern analysis within `R`. As always, the development version of `pavo` can be found on [github][pavo_repo], while the stable release is available via CRAN.
## Classes and Attributes
To enable the comprehensive workflow of `pavo`, we've implemented an expanded class system. Spectra will be of class `rspec` as long as we use one of `pavo`'s spectral import or processing functions, or explicitly convert an object using `as.rspec()`. Similarly, images will be of class `rimg` when imported via `getimg()`, or if converted using `as.rimg()`. The results of `vismodel()` are objects of class `vismodel` and the results of `colspace()` are, unsurprisingly, objects of class `colspace`. Most of these classes inherit from `data.frame`, and contain a suite of attributes that describe the object's characteristics (e.g. options used in visual modelling such as the selected visual system and illuminant, and properties of the modelled colourspace). These are easily viewed using the `summary` function (on any `rspec`, `rimg`, `vismodel`, or `colspace` object), which will return the attributes and summary data (where appropriate) in a readable format.
## Suggestions and Assistance
For suggestions, assistance and/or bug reports, we suggest getting in touch via the [colRverse discussion board](https://github.com/thomased/colRverse/discussions). It requires a github account, however, so if you don't have and/or want one the feel free to just [email Tom](mailto:thomas.white026@gmail.com) and we'll get back to you as soon as possible. If you have a bug to report, we'd appreciate it if you could also include a reproducible example when possible. Users familiar with GitHub may prefer to open an issue on the project's [github page][pavo_repo], or to make a pull-request directly.
## Citation of methods implemented in `pavo`
Most of the methods implemented in `pavo` have been thoroughly described in their original publications, to which users should refer for details and interpretation. For reflectance shape variables ("objective colourimetrics") and their particular relation to signal production and perception, see @Andersson2006 and @Montgomerie2006. Visual models based on photon catches and receptor noise are detailed in @Vorobyev1998 and @Vorobyev1998, and photoreceptor sensitivity curve estimation in @Govardovskii2000 and @Hart2005. For tetrahedral colourspace model implementations and variable calculations, see @Endler2005 and @Stoddard2008, and for colour volume overlap see @Stoddard2008 and @Stoddard2011. Adjacency and boundary strength analyses are described in @Endler2012 and @Endler2018, while overall pattern contrast is detailed in @Endler2005. Users of the functions that apply these methods must cite the original sources as appropriate, along with `pavo` itself:
```{r, comment=""}
citation(package = "pavo")
```
## Acknowledgements
We would like to thank Matthew D. Shawkey and Stephanie M. Doucet for insights and support, and Jarrod D. Hadfield and Mary Caswell Stoddard for sharing code that helped us develop some of `pavo`'s capabilities.