knitr::opts_chunk$set(echo = TRUE)
library(wastdr)
library(etlTurtleNesting)
library(ruODK)
library(dplyr)
library(janitor)
library(reactable)
library(sf)
x <- readRDS(here::here("inst/data/wastd_data_pth.rds"))
sw <- geojsonsf::geojson_sf(here::here("inst/data/seawall.geojson")) %>%
dplyr::transmute(subsite = name)
x$tracks <- x$tracks %>%
wastdr::filter_realspecies() %>%
dplyr::filter(season > 2018, site_name == "Port Hedland Cemetery Beach") %>%
sf::st_as_sf(coords = c("longitude", "latitude"), crs = 4326, remove = FALSE) %>%
sf::st_join(sw) %>%
wastdr::sf_as_tbl()
x$animals <- x$animals %>%
wastdr::filter_realspecies() %>%
dplyr::filter(
taxon == "Cheloniidae",
season > 2018,
site_name == "Port Hedland Cemetery Beach"
) %>%
sf::st_as_sf(
coords = c("longitude", "latitude"),
crs = 4326,
remove = FALSE
) %>%
sf::st_join(sw) %>%
wastdr::sf_as_tbl()
x$nest_excavations <- x$nest_excavations %>%
wastdr::filter_realspecies() %>%
dplyr::filter(
season > 2018,
encounter_site_name == "Port Hedland Cemetery Beach"
) %>%
sf::st_as_sf(
coords = c("encounter_longitude", "encounter_latitude"),
crs = 4326,
remove = FALSE
) %>%
sf::st_join(sw) %>%
wastdr::sf_as_tbl()
x_reh <- x
x_reh$tracks <- x_reh$tracks %>%
dplyr::filter(subsite == "rehab")
x_reh$animals <- x_reh$animals %>%
dplyr::filter(subsite == "rehab")
x_reh$nest_excavations <- x_reh$nest_excavations %>%
dplyr::filter(subsite == "rehab")
x_sea <- x
x_sea$tracks <- x_sea$tracks %>%
dplyr::filter(subsite == "seawall")
x_sea$animals <- x_sea$animals %>%
dplyr::filter(subsite == "seawall")
x_sea$nest_excavations <- x_sea$nest_excavations %>%
dplyr::filter(subsite == "seawall")
rt <- . %>%
janitor::clean_names() %>%
reactable::reactable(
filterable = TRUE,
sortable = TRUE,
searchable = TRUE,
defaultColDef = reactable::colDef(html = TRUE)
)
Data was extracted from WAStD on 2022-06-23 13:20:49 AWST.
The above areas “rehab” (Rehabilitation Zone) and “seawall” (Seawall footprint) were digitised from visual interpretation of the maps above and extended to the waterline.
wastdr::leaflet_basemap() %>%
leaflet::addPolygons(data = sw, label = ~subsite) %>%
leaflet::setView(118.615, -20.306, 18)
x$animals %>%
wastdr::map_mwi(sites = x$sites, cluster = TRUE) %>%
leaflet::addPolygons(data = sw, label = ~subsite) %>%
leaflet::setView(118.615, -20.306, 15)
x$tracks %>%
wastdr::map_tracks(sites = x$sites, cluster = TRUE) %>%
leaflet::addPolygons(data = sw, label = ~subsite) %>%
leaflet::setView(118.615, -20.306, 15)
A visual check whether the data was correctly clipped to the subsites rehab and seawall.
x_reh$tracks %>%
wastdr::map_tracks(cluster = TRUE) %>%
leaflet::addPolygons(data = sw, label = ~subsite) %>%
leaflet::setView(118.615, -20.306, 15)
x_sea$tracks %>%
wastdr::map_tracks(cluster = TRUE) %>%
leaflet::addPolygons(data = sw, label = ~subsite) %>%
leaflet::setView(118.615, -20.306, 15)
x %>%
wastdr::total_emergences_per_site_season_species() %>%
rt()
x_reh %>%
wastdr::total_emergences_per_site_season_species() %>%
rt()
x_sea %>%
wastdr::total_emergences_per_site_season_species() %>%
rt()
x %>% wastdr::nesting_success_per_area_season_species() %>% rt()
x_reh %>% wastdr::nesting_success_per_area_season_species() %>% rt()
x_sea %>% wastdr::nesting_success_per_area_season_species() %>% rt()
x$nest_excavations %>% wastdr::hatching_emergence_success_area() %>% rt()
x_reh$nest_excavations %>% wastdr::hatching_emergence_success_area() %>% rt()
x_sea$nest_excavations %>% wastdr::hatching_emergence_success_area() %>% rt()