Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mstrimas/colorist
Tools for Coloring Wildlife Distributions in Space-time
https://github.com/mstrimas/colorist
Last synced: 11 days ago
JSON representation
Tools for Coloring Wildlife Distributions in Space-time
- Host: GitHub
- URL: https://github.com/mstrimas/colorist
- Owner: mstrimas
- License: gpl-3.0
- Created: 2019-10-09T14:03:26.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-29T18:30:45.000Z (6 months ago)
- Last Synced: 2024-10-13T19:13:06.296Z (24 days ago)
- Language: R
- Homepage: http://strimas.com/colorist/
- Size: 114 MB
- Stars: 12
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
Awesome Lists containing this project
README
---
output: github_document
editor_options:
chunk_output_type: console
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
message = FALSE,
warning = FALSE,
error = FALSE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
dpi = 300
)
```# colorist
[![CRAN status](https://www.r-pkg.org/badges/version/colorist)](https://CRAN.R-project.org/package=colorist)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
[![R-CMD-check](https://github.com/mstrimas/colorist/workflows/R-CMD-check/badge.svg)](https://github.com/mstrimas/colorist/actions)Maps are essential tools for communicating information about wildlife distributions in space and time. Visualizing patterns of stasis and change can be a challenge, however, especially when distributions exhibit different degrees of spatiotemporal overlap. The typical strategy of layering distributional information from different time periods in a single map often results in occluded or muddied data, depending on how layers are combined. `colorist` is designed to address this challenge by providing multiple approaches to coloring and visualizing wildlife distributions in space-time using raster data. In addition to enabling simultaneous display of a series of distributions through the use of small multiples, `colorist` provides functions for extracting several features of interest from a set of distributions and for visualizing those features using HCL (hue-chroma-luminance) color palettes. The resulting maps allow for "fair" visual comparison of intensity values (e.g., occurrence, abundance, or density values) across space and time and can be used to address questions about where, when, and how consistently a species, individual, or group is likely to be found.
## Installation
Install `colorist` from CRAN with:
```{r cran-install, eval = FALSE}
install.packages("colorist")
```Alternatively, you can install the development version of `colorist` from [GitHub](https://github.com/mstrimas/colorist) with:
```{r install, eval = FALSE}
# install.packages("remotes")
remotes::install_github("mstrimas/colorist")
```## Background
The proliferation of tracking data and observations of wildlife populations have enabled remarkable growth in our understanding of how animals move through space and time. The goal of `colorist` is to help researchers explore and communicate this information by giving them tools to color wildlife distributions in space and time. `colorist` contains functions to summarize three distributional features of interest across a set of raster distributions: 1) maximum intensity (i.e., the maximum occurrence, abundance, or density value), 2) layer of maximum intensity (i.e., the identity of the layer containing the maximum intensity value), and 3) specificity of the maximum intensity value to the layer of maximum intensity (i.e., the degree to which intensity values are unevenly distributed across layers). Each of these metrics can be mapped to HCL (hue-chroma-luminance) colors in specific ways to ensure that data extracted from different raster layers have approximately equal perceptual weights in subsequent map visualizations.
## Usage
`colorist` works on raster data stored as `RasterStack` objects. Individual raster layers might represent an ordered temporal sequence of species distributions or utilization distributions. Alternatively, raster layers might represent an unordered set of distributions for multiple species, or individuals, within a single time period. Whatever temporal or identity relationships exist within the stack, all raster layers should contain values in the same units (e.g., abundance, occurrence, or probability density) to ensure that they can be meaningfully compared. The basic workflow for `colorist` is as follows:
1. **Metrics:** Users calculate metrics to describe their distributions.
2. **Color palette:** Users choose colors to describe distributions.
3. **Map:** Users map distributions in a series of small multiples or in a single map.
4. **Legend:** Users generate a legend to accompany their map.We can demonstrate this workflow using an example dataset of monthly Field Sparrow occurrence probability estimates from [eBird Status & Trends](https://ebird.org/science/status-and-trends).
```{r elephant}
library(colorist)# load example data, field sparrow occurrence probability
data("fiespa_occ")# calculate distribution metrics
r <- metrics_distill(fiespa_occ)# generate hcl color palette
pal <- palette_timecycle(fiespa_occ)# map
map_single(r, pal, lambda_i = -2)# legend
legend_timecycle(pal)
```