Skip to content

pavo

2.10.0Package record

Perceptual Analysis, Visualization and Organization of Spectral Colour Data

1packages dependsuggested by 3
10.6Kdownloads / year
60.1%test coverage
13/13flavors OK

Overview

About

A cohesive framework for the spectral and spatial analysis of colour described in Maia, Eliason, Bitton, Doucet & Shawkey (2013) doi:10.1111/2041-210X.12069 and Maia, Gruson, Endler & White (2019) doi:10.1111/2041-210X.13174.

Changes in 2.10.0

MAJOR CHANGES

  • sensmodel() gains a template argument, selecting the visual pigment template used to generate sensitivity curves. It names both the author and the chromophore, since a template's shape depends on both, and defaults to "govardovskii_a1", which is what every previous version of the function used. "govardovskii_a2" adds the vitamin A2 template from the same paper, and "ssh_a1" and "ssh_a2" the two from Stavenga, Smits and Hoenders (1993). The A2 templates cover porphyropsin pigments, found in freshwater fish, amphibians, and species that switch chromophore seasonally, which pavo previously could not model at all: an A2 band is close to 20% broader than the A1 band at the same peak sensitivity, so it is not recovered by adjusting peaksens. "govardovskii_a2" is the one to reach for, since pairing it with the default compares chromophores without also changing template family. The template used is recorded as a "template" attribute on the result. Note that beta = FALSE is recommended with either SSH template: their beta band has a fixed peak wavelength rather than one that scales with peaksens, so for short-wavelength pigments it pulls the maximum of the summed curve several nm away from the value asked for, and sensmodel() warns where that shift exceeds 5 nm. The alpha band on its own is unaffected, both Govardovskii beta bands scale with peaksens and do not have this problem, and Stavenga (2010) notes the fixed beta peak to be a known shortcoming.
Show all changes in 2.10.0Hide the rest of the changes in 2.10.0
  • bootcoldist() gains a ci.type argument, allowing bias-corrected and accelerated (BCa) confidence limits as an alternative to the percentile limits it has always returned. Colour distances are bounded below by zero and typically right-skewed, so percentile limits tend to sit off-centre; BCa corrects for that skew and for where the empirical distance falls in the bootstrap distribution. The acceleration term comes from a jackknife leaving out one row at a time, or one cluster where cluster is supplied. The default remains "perc".
  • bootcoldist() gains a cluster argument for hierarchically structured data, such as several patches per individual, or repeated measurements of one individual. Bootstrap replicates then resample whole clusters rather than rows, so non-independent observations stay together and the effective sample size is the number of clusters. The nesting argument controls whether clusters span the levels of by ("crossed", one draw shared across groups, preserving their pairing) or sit within one level ("nested", drawn independently per group), and defaults to detecting which applies. Empirical means are unaffected, and results are unchanged when cluster is NULL.
  • bootcoldist() gains a correct argument, which removes the upward bias in the distance between group means that comes of those means being estimated rather than known. Distance is convex in the error of a mean, so two noisy centroids sit further apart than the true ones, and two samples of one population are separated by an apparently non-zero distance. On the squared scale the displacement is the sum over groups of the mean squared pairwise distance among a group's observations divided by twice their number, so it is worst for small, variable groups and does not fall away as the true separation approaches zero. It is therefore largest exactly where discriminability is in question. correct = TRUE subtracts it from the empirical distance and from every bootstrap replicate, each using the observations it drew. Where cluster is supplied the correction works on clusters rather than rows, matching what is resampled; from rows it can understate the displacement several-fold. Where the design is crossed, the two group means are correlated and the correction uses each individual's own paired difference, which carries that covariance; treating the groups as independent would subtract several times too much. Partly crossed designs are refused, as is nesting = "nested" where clusters in fact span groups. The subtraction is exactly unbiased on the squared scale. Its square root errs slightly low, so a corrected distance is a little conservative. Exactness also assumes clusters of roughly equal size; under marked imbalance the between-cluster part is under-corrected and the within-cluster part over-corrected, so the net direction depends on which dominates. The correction is unavailable under quantum noise, in the CIELAB, CIELCh and coc spaces, for achromatic contrast in a colourspace model, and with ci.type = "bca". The default is FALSE, so results are unchanged unless it is asked for.
  • procspec() gains a new "clip" option, controlled by the new clip_range argument to remove entire regions of the spectra and replace them by linear interpolation. Code contributed for by @rscherrer, addressing issue #271.
  • the rimg2cimg() function has been removed in favour of a custom as.cimg() method.

MINOR CHANGES

  • bootcoldist() with correct = TRUE now returns the signed corrected square as the "dS.sq" attribute of the result. Flooring at zero is a presentation choice, since a negative squared distance cannot be reported as a distance, but the signed value is the quantity the correction is unbiased for and the one to carry into a further calculation.
  • bootcoldist() now validates achromatic, erroring where it is not a single TRUE or FALSE.
  • bootcoldist() now says how many bootstrap replicates failed and why, where it previously discarded the error and reported only that "Bootstrap sampling encountered errors". A run in which every replicate failed used to produce an unrelated error about a comparison of length zero, and is now reported like any other failure.
  • bootcoldist() now fails with an informative error when boot.n is too small for the requested alpha. Previously the lower quantile index rounded down to zero, and the interval failed to assemble with an unrelated message about mismatched dimnames. With the default alpha this affected any boot.n below 20.
  • default values for some arguments in explorespec() and sensmodel() are now explicit in the function definition.
  • as.rspec() now works out of the box with tibble, rather than requiring users to pass a standard data.frame.
  • argument checks in colspace() internal functions (dispace(), trispace(), hexagon(), etc.) have been refactored (#263), with two minor user-facing consequences:
  • some messages in tcspace() have been converted to warnings for consistency with the other internal colspace functions
  • some error messages are been reorder, which means that errors produced for inputs invalid for multiple reasons may appear in a different order than in previous versions.
  • pavo now uses R 4.1 (released in 2021) as the minimum required R version.

BUG FIXES

  • coldist() with noise = "quantum" built the photon-noise term from log-transformed quantum catches whenever qcatch = "Qi", rather than from the catches themselves. The term is 2 / (Qa + Qb) and was being computed as 2 / (log Qa + log Qb), which inflates the noise, deflates the resulting distances, and leaves the quantum model short of the neural one however bright the illuminant. Results were correct for qcatch = "fi" input throughout. If you have run coldist() or bootcoldist() with noise = "quantum" and qcatch = "Qi" on any version from 2.4.0 onward, those distances need recalculating. Reported by Changku Kang, issue #281.
  • Following the above, quantum catches below one are no longer an error in coldist(). They describe a dim, photon-limited stimulus, and give small distances rather than negative log catches. Non-positive catches remain an error, since the noise term is undefined for them.
  • coldist() with noise = "quantum" and achromatic = TRUE returned NA for the achromatic distances to the reference stimuli that anchor jnd2xyz(). Those were then read as zeros, putting the achromatic reference on top of the data. Luminance coordinates from jnd2xyz() change for quantum-noise models; under the default center = TRUE only the stored reference coordinates move.
  • sensmodel() now generates the same sensitivity curve for a given peaksens whatever range is requested. The alpha-band expression of Govardovskii et al. (2000) contains a constant of 300 nm, which was coded as range[1]. Since the two coincide at the default range = c(300, 700), curves were correct for that range and for any range sharing its lower bound. Users who called sensmodel() with a lower bound other than 300 nm should consider regenerating their sensitivities and rerun any downstream vismodel() or coldist() results. Everyone else is unaffected and results are unchanged.
  • jndrot() and by extension jnd2xyz() have been adjusted for trichromats to only allow rotations in the 2D plane. Until now, 3D rotations were allowed and the result was projected back in 2D but this meant that the output was no longer representing JNDs distances. Because rotate = TRUE is the default in jnd2xyz(), we recommend you re-run any jnd2xyz() computation on trichromats. From our tests, results stay qualitatively similar but specific values may change.
  • bootcoldist() now summarises colspace() objects by the arithmetic mean of their coordinates, rather than a geometric mean of coordinates shifted by an arbitrary constant of 100. Distances in a colour space are measured in the coordinates themselves, so a group's centroid is their arithmetic mean. Quantum catches and luminance channels stay geometric, since those distances are linear in the logged values. Colspace distances change slightly. CIELAB, CIELCh and segment, whose coordinates can be negative, previously returned NaN and now work.
  • bootcoldist() now summarises qcatch = "fi" models by an arithmetic mean of the log catches rather than a geometric one, so reported distances for such models change. fi values are already log(Qi), and their geometric mean is not a centroid: "Qi" and "fi" models of the same data disagreed by around 6% on the bundled sicalis data, and the distance depended on the factor the illuminant was scaled by, though scaling shifts every log catch equally and cannot change a chromatic distance. Calls that returned NaN because an unscaled illuminant made log catches negative now work.
  • bootcoldist() now takes qcatch from a vismodel or colspace object's attribute, as coldist() always has, rather than letting an argument override it. Results change only where the two disagreed, in which case the old behaviour was wrong.
  • bootcoldist() now errors where any bootstrapped distance is NA, rather than silently taking confidence limits from the wrong order statistics. The usual cause is achromatic = TRUE on a model built without an achromatic channel.
  • bootcoldist(raw = TRUE) now returns bootstrap distances in replicate order. Each contrast was previously sorted independently before being returned, so values sharing a row came from different resamplings, and neither different contrasts nor dS and dL could be compared with one another. The values themselves are unchanged, only their order.
  • the values of avg.uv and avg.v visual systems used in sensdata() and vismodel() have been updated to match exactly the ones provided in the original source (Endler & Mielke 2005). This may result in minute changes in the values returned by vismodel() if you are using these parameters.

INTERNAL CHANGES

  • dependency on the viridisLite package has been removed in favour of recent base R functions

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 4.7 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-04-10
  • ERROR13 OK, 1 ERROR2026-04-09
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 2.10.0
READMEYes · 399 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 2.10.0Citation fileYes · cites a publicationWebsiteYes · pkgdown
Help pages
71 (25 internal)includes a package overview page
Examples that run
93%54 run in a plain check (3 of them under a condition) · 4 only when donttest examples are enabled (R CMD check --as-cran)
Exported functions with examples
94%
Documented parameters
90%
Return-value docs
80%
Help pages citing references
66%

Downloads

10.6K
CRAN downloads in the past year
Rank #3,685 · ~29/day · ~880/mo
Daily download trend is not available in this view yet.
1.2K30 days
2.6K90 days
10.6K1 year
Compare downloads with other packages →
Also on114 r2u12 autocran

Repository

81Stars
18Forks
22Open issues
5Open PRs
19Releases
3,195Commits
19Commit identities
r
License file reads as GPL-2.0 · 3,195 commits · Last activity 2026-10-12 · 0% stars, 30d · Default branch at 2.11.0, ahead of CRAN 2.10.0 (checked 2026-10-11)
Responsiveness
How these are sampled
PRs merged (all time)
92%
Median days to close, 50 most recently updated closed issues
43
Median days to close, 50 most recently updated closed PRs
4

Stars over time

2025-07-16 · 772026-07-07 · 81
PracticesBeta

18 development-tooling and community-health practices detected across 8 families in the upstream repository

Checks run against github.com/rmaia/pavo on 2026-10-11.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (2)
Code of conductContributing guide
Docs source (4)
README.qmdpkgdown

GitHub Pages site last deployed 2026-09-15 · The repository has a site deploy workflow

pkgdown site last built 2026-09-15

Coverage (2)
Coverage reporting (Codecov).covrignore
Show all practicesHide 4 practices
Reproducibility and dev environment (2)
data-raw/Dockerfile
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Lint, format, editor (3)
lintrLint workflowEditorConfig
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
17 external dependencies (excludes base and recommended)

Installing pavo adds 33 packages (19 with compiled code, 35 MB of source tarballs). Heaviest: sf 9.3 MB, lightr 5.0 MB, magick 4.4 MB.

Depends (1)
R >= 4.1
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
1direct
1indirect
Imports 1
Suggested by 3
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

Datasets

People & History

People (6)
Author, Maintainer since 2.5.0 (2020) · added in 1.0.0
Author · added in 2.1.0
Author · added in 1.4.0

Previously maintained by Rafael Maia (0.1-1 to 2.4.0).

Releases (32)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • unarchivedReturned to CRAN
    2020-12-18
  • archivedRemoved from CRAN
    2020-12-09
    policy violation Creates 'bin/phantomjs' in home
  • R
    R 4.0.0 released · 2020-04-24
  • unarchivedReturned to CRAN
    2019-12-11
  • archivedRemoved from CRAN
    2019-12-08
    check errors were not corrected in time From digest including attributes, hence 'random' results in checks
  • R
    R 3.6.0 released · 2019-04-26
  • R
    R 3.5.0 released · 2018-04-23
  • R
    R 3.4.0 released · 2017-04-21
  • R
    R 3.3.0 released · 2016-05-03
  • R
    R 3.2.0 released · 2015-04-16
Show 35 earlier eventsHide 35 earlier events
  • R
    R 3.1.0 released · 2014-04-10
  • 3.0.2Latest
    record
    2013-09-01 · current release · diff ↗
  • R
    R 3.0.0 released · 2013-04-03
  • 2.15.3
    record
    2012-12-07 · diff ↗
  • 2.15.2
    record
    2012-10-05 · diff ↗ ·
    added 24 exports
    aggplot, aggspec, as.rspec, bgandilum, coldist, explorespec, getspec, is.rspec, peakshape, plotsmooth, procspec, projplot, segclass, sensmodel, spec2rgb, summary.tcs, tcs, tcsplot, tcspoints, tcsvol, ttvertex, vismodel, vissyst, voloverlap
  • 2.10.0
    record
    2026-09-14 · diff ↗ ·
    removed 1 export
    rimg2cimg
  • 2.9.0
    record
    2023-09-24 · diff ↗ ·
    added 1 export
    simulate_spec
  • 2.8.0
    record
    2022-08-16 · diff ↗
  • 2.7.1
    record
    2021-09-21 · diff ↗
  • 2.7.0
    record
    2021-03-23 · diff ↗
  • 2.6.1
    record
    2020-12-18 · diff ↗
  • 2.6.0
    record
    2020-12-09 · diff ↗
  • 2.5.0
    record
    2020-11-12 · diff ↗
  • 2.4.0
    record
    2020-02-08 · diff ↗
  • 2.3.0
    record
    2019-12-11 · diff ↗
  • 2.2.0
    record
    2019-06-25 · diff ↗ ·
    removed 1 export
    cimg2rimg
    added 1 export
    rimg2magick
  • 2.1.0
    record
    2019-03-06 · diff ↗ ·
    removed 8 exports
    bgandilum, getspecf, getspecf2, segclass, tcs, transmissiondata, ttvertex, vissyst
    added 2 exports
    is.colspace, is.vismodel
  • 2.0.0
    record
    2018-09-22 · diff ↗ ·
    added 8 exports
    adjacent, as.rimg, cimg2rimg, classify, getimg, is.rimg, procimg, rimg2cimg
  • 1.4.0
    record
    2018-07-11 · diff ↗ ·
    added 2 exports
    getspecf, getspecf2
  • 1.3.1
    record
    2017-10-03 · diff ↗ ·
    added 1 export
    bootcoldist
  • 1.3.0
    record
    2017-09-20 · diff ↗ ·
    added 5 exports
    coldist2mat, jnd2xyz, jndplot, jndrot, sensdata
  • 1.1.0
    record
    2017-05-06 · diff ↗ ·
    added 2 exports
    segplot, segspace
  • 1.0.1
    record
    2017-03-16 · diff ↗
  • 1.0.0
    record
    2016-12-05 · diff ↗ ·
    removed 1 export
    summary.tcs
    added 20 exports
    axistetra, categorical, catplot, cie, cieplot, coc, cocplot, colspace, diplot, dispace, hexagon, hexplot, legendtetra, projpoints, tcspace, tetraplot, transmissiondata, triplot, trispace, vol
  • 0.5-6
    record
    2016-10-20 · diff ↗
  • 0.5-5
    record
    2016-03-09 · diff ↗
  • 0.5-4
    record
    2016-01-28 · diff ↗
  • 0.5-2
    record
    2015-06-11 · diff ↗
  • 0.5-1
    record
    2013-09-04 · diff ↗
  • 0.5
    record
    2013-06-09 · diff ↗
  • 0.3-1
    record
    2013-05-06 · diff ↗ ·
    added 2 exports
    flux2irrad, irrad2flux
  • 0.3
    record
    2013-04-23 · diff ↗
  • 0.1-2
    record
    2013-01-12 · diff ↗
  • 0.1-1
    record
    2012-12-05
  • R
    R 2.15.0 released · 2012-03-30

Package metadata

First published
2012-10-05
Total releases
32 / 14 yrs
License
GPL (>= 2) OSI · relicensed from BSD in 0.5-1
Minimum R
≥ 4.1
Bundled data
181 KB / 3 files
Download size
1.5 MB

Cite

Cite this package

Run in R for the authors' entry:

citation("pavo")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.1111/2041-210x.12069, 10.1111/2041-210x.13174.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for pavo version 2.10.0 [Data set]. HJJB, LLC. Data release v2026-10-18. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy