knitr::opts_chunk$set(echo = TRUE, warning = F, message = F)

box::use(
  here[...], 
  ggplot2[...], 
  tidyr[...],
  dplyr[...], 
  ggridges[...],
  reactable[...],
  lubridate[ymd, year], 
  stringr[str_wrap],
  forcats[fct_reorder2], 
  htmltools[h5], 
  htmlwidgets[prependContent],
  plotly[...]
)

source(here('R/funcs.R'))

load(file = here('data/vegdat.RData'))
load(file = here('data/treedat.RData'))

thm <- theme_minimal(base_size = 14) + 
  theme(
    panel.grid.minor = element_blank() 
  )

vegdat <- vegdat %>% 
  filter(sample != 2)

# test args
site <- 'Big Bend - TECO'
sp <- 'Avicennia germinans'

Plot showing number of times a zone was identified across transects, dates.

zonecnt_plo(vegdat, thm)

Plot showing total distance zone was recorded across transect, dates.

zonedst_plo(vegdat, thm)

An example showing zones for two sample dates at one site.

sitezonedst_plo1(vegdat, site = site, zonefct = NULL, thm = thm)

To evaluate simple changes in zones over time, an estimate of total distance per zone between time points could be evaluated. This is also very similar to the previous plot.

sitezonedst_plo2(vegdat, site = site, zonefct = NULL, thm = thm)

The same site, but showing species data along the transect.

sitezonedst_plo3(vegdat, site, thm = thm)

An evaluation of a single species across all sites, can be shown as frequency occurrence across the transect or mean percent basal cover. This example shows frequency occurrence of Avicennia germinans.

sppsum_plo(vegdat, sp, var = 'fo', thm = thm)

And now average percent basal cover.

sppsum_plo(vegdat, sp, var = 'cover', thm = thm)

A table of species frequency occurrence by zone, over time:

sitezonesum_tab(vegdat, site = site)

Same thing but as percent basal cover.

sitezonesum_tab(vegdat, site = site, var = 'cover')

A plot of sum of percent basal cover by arbitrary meter markings, top species, and across zones.

sitesum_plo(vegdat, site, delim = 10, vegsel = 8, var = 'cover', thm = thm, delimtyp = 'Number')

A plot of mean percent basal cover by arbitrary meter markings, top species, and for select zones.

sitesum_plo(vegdat, site, delim = 10, vegsel = 8, var = 'cover', zonefct = c('A: Mangrove Fringe', 'G: Coastal Upland'), thm = thm,  delimtyp = 'Number')

Tabular summary of tree data by site, species.

treesum_tab(treedat, site = site, byspecies = T, var = 'trees_ha')
Big Bend - TECO, Absolute species density (trees/ha)

Same table as above, but aggregated across species.

treesum_tab(treedat, site = site, byspecies = F, var = 'trees_ha')
Big Bend - TECO, Absolute species density (trees/ha)

Tree summary plot by site, species.

treesum_plo(treedat, site = site, byspecies = T, var = 'trees_ha', thm = thm)

Tree summary plot, but aggregated across species.

treesum_plo(treedat, site = site, byspecies = F, var = 'trees_ha', thm = thm)