Skip to contents

Plot species diversity at cameras

Usage

plot_diversity(
  df,
  div_col,
  cam_col,
  cam_vec = NULL,
  round = 3,
  interactive = FALSE
)

Arguments

df

The dataframe with diversity indices per camera

div_col

Name of the column containing the diversity index to plot

cam_col

Name of the column containing the cameras names

cam_vec

A character vector of all cameras that should appear on the plot (optional)

round

Rounding option for the diversity indices displayed when hovering. NULL is for no rounding.

interactive

Make the plot interactive?

Value

A ggplot object representing diversity indices as bars (in x) following the different cameras (in y).

Examples

# Create synthetic data ---
df <- data.frame("camera" = c("C1", "C2", "C4", "C3"),
                 "count" = c(1, 4, 2, 22))

plot_diversity(df, 
               div_col = "count", 
               cam_col = "camera")