plot_pis: Plot predictor importances boxplot

Description Usage Arguments Value Examples

View source: R/ebirdst-plotting.R

Description

For all of the available predictors in a single set of species eBird Status and Trends products, this function makes a bar plot of those relative importances, from highest to lowest. Many function parameters allow for customized plots.

Usage

1
2
3
4
5
6
7
8
plot_pis(
  pis,
  ext,
  by_cover_class = FALSE,
  n_top_pred = 50,
  pretty_names = TRUE,
  plot = TRUE
)

Arguments

pis

data.frame; predictor importance data from load_pis().

ext

ebirdst_extent object; the spatiotemporal extent to filter the data to. Required, since results are less meaningful over large spatiotemporal extents.

by_cover_class

logical; whether to aggregate the four FRAGSTATS metrics for the land cover classes into single values for the land cover classes.

n_top_pred

integer; how many predictors to show.

pretty_names

logical; whether to convert cryptic land cover codes to readable land cover class names.

plot

logical; whether to plot predictor importance or just return top predictors.

Value

Plots a boxplot of predictor importance and invisibly returns a named vector of top predictors, and their median predictor importance, based on the n_top_pred parameter.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# download and load example data
sp_path <- ebirdst_download("example_data", tifs_only = FALSE)
pis <- load_pis(sp_path)

# define a spatiotemporal extent to plot data from
bb_vec <- c(xmin = -86, xmax = -83, ymin = 41.5, ymax = 43.5)
e <- ebirdst_extent(bb_vec, t = c("05-01", "05-31"))

top_pred <- plot_pis(pis, ext = e, by_cover_class = TRUE, n_top_pred = 10)
top_pred

## End(Not run)

ebirdst documentation built on Jan. 16, 2021, 5:16 p.m.