Mapping species abundance across the full-annual cycle presents a challenge, in that patterns of concentration and dispersion in abundance change throughout the year, making it difficult to define color bins that suit all seasons and accurately reflect the detail of abundance predictions. To address this, we selected a method (described by Maciejewski et al. 2013) that first selects an optimal power (the Box-Cox method) for normalizing the data, then power transforms the entire year of non-zero data, constructs bins with the power-transformed data using standard-deviations, and then un-transforms the bins. To access a pre-calculated bins for the full annual cycle use load_fac_map_parameters().

calc_bins(x, method = c("boxcox", "quantile"))

Arguments

x

RasterStack or RasterBrick; original eBird Status and Trends product raster GeoTIFF with 52 bands, one for each week.

method

character; method to calculate bins: "boxcox" for bins based on standard deviations of Box-Cox power-transformed data or "quantile" for quantile bins.

Value

A list with two elements: bins is a vector containing the break points of the bins and power is the optimal power used to transform data when calculating bins. If method = "quantile" is used, power will be missing.

Details

The Box-Cox method used in the online version of Status & Trends is used as the default for calculating bins; however, an alternative method using quantile-based bins can be used by setting method = "quantile".

References

Ross Maciejewski, Avin Pattah, Sungahn Ko, Ryan Hafen, William S. Cleveland, David S. Ebert. Automated Box-Cox Transformations for Improved Visual Encoding. IEEE Transactions on Visualization and Computer Graphics, 19(1): 130-140, 2013.

Examples

# \donttest{ # download and load example abundance data sp_path <- ebirdst_download("example_data")
#> Data already exists, use force = TRUE to re-download.
abd <- load_raster("abundance", sp_path) # calculate bins for a single week for this example bins_boxcox <- calc_bins(abd) # for some scenarios quantile bins may work better bins_quantile <- calc_bins(abd, method = "quantile") # }