knitr::opts_chunk$set(echo = TRUE)
library(wastdr)
library(etlTurtleNesting)
wamtram_data = readRDS(here::here("inst/w2.rds"))

Data current as of r wamtram_data$downloaded_on.

History of Flipper Tag r params$flipper_tag

obs_ft <- wamtram_data$obs_flipper_tags %>% 
  dplyr::filter(tag_name==params$flipper_tag) 

obs_ft %>% reactable::reactable()

Encounters involving Flipper Tag r params$flipper_tag

obs_ids <- obs_ft %>% dplyr::select(observation_id)

turtle_enc <- wamtram_data$enc %>% 
  dplyr::right_join(obs_ids, by="observation_id") 

turtle_enc %>% reactable::reactable()

Reconstructed record of encountered turtle

turtle_ids <- turtle_enc %>% dplyr::select(turtle_id)

turtle_records <- wamtram_data$reconstructed_turtles %>% 
  dplyr::right_join(turtle_ids, by="turtle_id")

turtle_records %>% reactable::reactable()

All encounters with observed turtle(s)

all_enc <- wamtram_data$enc %>% 
  dplyr::right_join(turtle_ids, by="turtle_id")

all_enc %>% reactable::reactable()

leaflet::leaflet(width = 800, height = 600) %>%
    leaflet::addProviderTiles("Esri.WorldImagery", group = "Aerial") %>%
    leaflet::addProviderTiles("OpenStreetMap.Mapnik", group = "Place names") %>%
    leaflet::clearBounds(.) %>%
        leaflet::addAwesomeMarkers(
          data = all_enc,
          lng = ~longitude, lat = ~latitude,
          icon = leaflet::makeAwesomeIcon(
            text = ~species_code,
            markerColor = "red"
          ),
          label = ~ glue::glue("{species_code} {observation_datetime_gmt08}"),
          popup = ~ glue::glue("{species_code} {observation_datetime_gmt08}")
        ) %>% 
    leaflet::addLayersControl(
      baseGroups = c("Aerial", "Place names")
    )


dbca-wa/etlTurtleNesting documentation built on Nov. 18, 2022, 8:03 a.m.