knitr::opts_chunk$set(echo = FALSE) library(tidyverse) library(leaflet) library(tmap)
This document provides a preliminary data quality check for data collected by Region 7 MBM Waterfowl Division aerial surveys using SCRIBE software (starting in 2023). Currently supported surveys include the Arctic Coastal Plain (ACP), Yukon-Kuskokwim Delta duck (YKD) and goose (YKG), Copper River Dusky (CRD), and North American Waterfowl Breeding Population (WBPHS).
All data checks are currently using assumptions for data fields as expected to be written into protocols and summarized and analyzed using the USFWS Alaska Region MBM survey analysis R package AKaerial. For information and current version, see https://github.com/USFWS/AKaerial.
You have chosen the file:
print(path.name)
For the area:
print(area)
We have standardized the mandatory column headings as:
r necessary
r if(s.colmatch != "green") {"\\begin{comment}"}
This file contains all of the required column names.
Status - GREEN
r if(s.colmatch != "green") {"\\end{comment}"}
r if(s.colmatch != "red") {"\\begin{comment}"}
This file does not contain all of the required column names.
r colnames(data)
Status - RED
r if(s.colmatch != "red") {"\\end{comment}"}
There are no spatial checks provided here, instead please review the plot of transect-level observations below for accuracy.
if(area != "WBPHS"){ tm <- tmap::tm_shape(basemap) + tmap::tm_polygons(col = "STRATNAME", alpha = 0.5) + tmap::tm_shape(sf.lines, name="Flown Track") + tmap::tm_lines() + tmap::tm_text("Transect", size=2) + tmap::tm_shape(sf.obs, name="Bird Obs") + tmap::tm_dots(col="Day") + tmap::tm_basemap(server = "Esri.WorldGrayCanvas") + tmap::tm_scale_bar() leaf = tmap::tmap_leaflet(tm) leaf }
Swan nests should only be recorded if a swan is also present (active). Correct notation is recording the nest as open, 1 and the associated swan on a separate entry as single or pair, 1.
r if(s.swan != "green") {"\\begin{comment}"}
All swan nests and associated swans appear to be recorded correctly.
Status - GREEN
r if(s.swan != "green") {"\\end{comment}"}
r if(length(test.swan$bad[,1]) == 0) {"\\begin{comment}"}
There are r length(test.swan$bad[,1])
not recorded as open, 1.
Status - RED
r if(length(test.swan$bad[,1]) == 0) {"\\end{comment}"}
r if(length(test.swan$missing[,1]) == 0) {"\\begin{comment}"}
There are r length(test.swan$missing[,1])
nests without associated swan records.
Status - RED
r if(length(test.swan$missing[,1]) == 0) {"\\end{comment}"}
The following Grouping codes are acceptable- single, pair, open, flkdrake. Leading or trailing spaces are not acceptable.
r if(s.unit != "green") {"\\begin{comment}"}
All Obs_Type codes appear to be recorded correctly.
Status - GREEN
r if(s.unit != "green") {"\\end{comment}"}
r if(length(test.unit$bad[,1]) == 0) {"\\begin{comment}"}
The following Obs_Type values are not acceptable (if more than 6, only the first 6 shown):
kableExtra::kable_styling(kableExtra::kable(head(test.unit$bad)))
Status - RED
r if(length(test.unit$bad[,1]) == 0) {"\\end{comment}"}
Seat codes must be either LF, RF, LR, or RR, and are case-sensitive.
r if(s.seat != "green") {"\\begin{comment}"}
All seat codes appear to be recorded correctly.
Status - GREEN
r if(s.seat != "green") {"\\end{comment}"}
r if(length(test.seat$bad[,1]) == 0) {"\\begin{comment}"}
The following seat values are not acceptable (first 6 shown):
kableExtra::kable_styling(kableExtra::kable(head(test.seat$bad)))
Status - RED
r if(length(test.seat$bad[,1]) == 0) {"\\end{comment}"}
The current list of acceptable species codes can be found in the object sppntable, or for WBPHS, WBPHSsppntable.
r if(s.species != "green") {"\\begin{comment}"}
All species codes appear to be recorded correctly, or at least an acceptable substitute is known (for any YELLOW status codes entered).
Status - GREEN
r if(s.species != "green") {"\\end{comment}"}
r if(length(test.species$change[,1]) == 0) {"\\begin{comment}"}
The following species codes are not acceptable and will be updated in the QC_Obs file:
kableExtra::kable_styling(kableExtra::kable(table(test.species$change$Species)))
Status - YELLOW
r if(length(test.species$change[,1]) == 0) {"\\end{comment}"}
r if(length(test.species$bad[,1]) == 0) {"\\begin{comment}"}
The following species codes are not acceptable and no replacement is available:
kableExtra::kable_styling(kableExtra::kable(table(test.species$bad$Species)))
Status - RED
r if(length(test.species$bad[,1]) == 0) {"\\end{comment}"}
Observer intials must be input as 3 characters, all uppercase.
r if(s.observer != "green") {"\\begin{comment}"}
All observers appear to be recorded correctly.
Status - GREEN
r if(s.observer != "green") {"\\end{comment}"}
r if(s.observer != "red") {"\\begin{comment}"}
Some observer initials have been entered incorrectly.
print(unique(data$Observer))
Status - RED
r if(s.observer != "red") {"\\end{comment}"}
Must be numeric.
r if(s.year != "green") {"\\begin{comment}"}
All years appear to be recorded correctly.
Status - GREEN
r if(s.year != "green") {"\\end{comment}"}
r if(s.year != "red") {"\\begin{comment}"}
There are non-numeric values in Year. If more than 6, only the first 6 shown.
kableExtra::kable_styling(kableExtra::kable(head(data[test.year$bad, ])))
Status - RED
r if(s.year != "red") {"\\end{comment}"}
r if(s.month != "green") {"\\begin{comment}"}
All months appear to be recorded correctly.
Status - GREEN
r if(s.month != "green") {"\\end{comment}"}
r if(s.month != "red") {"\\begin{comment}"}
There are non-numeric values in Month. If more than 6, only the first 6 shown.
kableExtra::kable_styling(kableExtra::kable(head(data[test.month$bad, ])))
Status - RED
r if(s.month != "red") {"\\end{comment}"}
r if(s.day != "green") {"\\begin{comment}"}
All days appear to be recorded correctly.
Status - GREEN
r if(s.day != "green") {"\\end{comment}"}
r if(s.day != "red") {"\\begin{comment}"}
There are non-numeric values in Day. If more than 6, only the first 6 shown.
kableExtra::kable_styling(kableExtra::kable(head(data[test.day$bad, ])))
Status - RED
r if(s.day != "red") {"\\end{comment}"}
Must all be numeric (or NA).
r if(s.wind != "green") {"\\begin{comment}"}
All Wind_Vel values appear to be recorded correctly.
Status - GREEN
r if(s.wind != "green") {"\\end{comment}"}
r if(s.wind != "red") {"\\begin{comment}"}
There are non-numeric values in Wind_Vel. If more than 6, only the first 6 shown.
kableExtra::kable_styling(kableExtra::kable(head(data[test.wind$bad, ])))
Status - RED
r if(s.wind != "red") {"\\end{comment}"}
r if(s.lat != "green") {"\\begin{comment}"}
All Latitude values appear to be recorded correctly.
Status - GREEN
r if(s.lat != "green") {"\\end{comment}"}
r if(s.lat != "red") {"\\begin{comment}"}
There are non-numeric values in Lat. If more than 6, only the first 6 shown.
kableExtra::kable_styling(kableExtra::kable(head(data[test.lat$bad, ])))
Status - RED
r if(s.lat != "red") {"\\end{comment}"}
r if(s.lon != "green") {"\\begin{comment}"}
All Longitude values appear to be recorded correctly.
Status - GREEN
r if(s.lon != "green") {"\\end{comment}"}
r if(s.lon != "red") {"\\begin{comment}"}
There are non-numeric values in Lon. If more than 6, only the first 6 shown.
kableExtra::kable_styling(kableExtra::kable(head(data[test.lon$bad, ])))
Status - RED
r if(s.lon != "red") {"\\end{comment}"}
r if(s.hdop != "green") {"\\begin{comment}"}
All HDOP appear to be recorded correctly.
Status - GREEN
r if(s.hdop != "green") {"\\end{comment}"}
r if(s.hdop != "red") {"\\begin{comment}"}
There are non-numeric values in HDOP. If more than 6, only the first 6 shown.
kableExtra::kable_styling(kableExtra::kable(head(data[test.hdop$bad, ])))
Status - RED
r if(s.hdop != "red") {"\\end{comment}"}
r if(s.distance != "green") {"\\begin{comment}"}
All distances appear to be recorded correctly.
Status - GREEN
r if(s.distance != "green") {"\\end{comment}"}
r if(s.distance != "red") {"\\begin{comment}"}
There are non-numeric values in Distance. If more than 6, only the first 6 shown.
kableExtra::kable_styling(kableExtra::kable(head(data[test.distance$bad, ])))
Status - RED
r if(s.distance != "red") {"\\end{comment}"}
r if(s.count != "green") {"\\begin{comment}"}
All group sizes (Count) appear to be recorded correctly.
Status - GREEN
r if(s.count != "green") {"\\end{comment}"}
r if(s.count != "red") {"\\begin{comment}"}
There are non-numeric values in Count. If more than 6, only the first 6 shown.
kableExtra::kable_styling(kableExtra::kable(head(data[test.count$bad, ])))
Status - RED
r if(s.count != "red") {"\\end{comment}"}
r if(s.alt != "green") {"\\begin{comment}"}
All altitudes appear to be recorded correctly.
Status - GREEN
r if(s.alt != "green") {"\\end{comment}"}
r if(s.alt != "red") {"\\begin{comment}"}
There are non-numeric values in Altitude. If more than 6, only the first 6 shown.
kableExtra::kable_styling(kableExtra::kable(head(data[test.alt$bad, ])))
Status - RED
r if(s.alt != "red") {"\\end{comment}"}
r if(s.speed != "green") {"\\begin{comment}"}
All speeds appear to be recorded correctly.
Status - GREEN
r if(s.speed != "green") {"\\end{comment}"}
r if(s.speed != "red") {"\\begin{comment}"}
There are non-numeric values in Speed. If more than 6, only the first 6 shown.
kableExtra::kable_styling(kableExtra::kable(head(data[test.speed$bad, ])))
Status - RED
r if(s.speed != "red") {"\\end{comment}"}
r if(s.sat != "green") {"\\begin{comment}"}
All # Satellite values appear to be recorded correctly.
Status - GREEN
r if(s.sat != "green") {"\\end{comment}"}
r if(s.sat != "red") {"\\begin{comment}"}
There are non-numeric values in # Satellites. If more than 6, only the first 6 shown.
kableExtra::kable_styling(kableExtra::kable(head(data[test.sat$bad, ])))
Status - RED
r if(s.sat != "red") {"\\end{comment}"}
obs_plot= ggplot2::ggplot(data, ggplot2::aes(Grouping)) + ggplot2::geom_bar(fill = "#0073C2FF") sp_plot= ggplot2::ggplot(data, ggplot2::aes(Species)) + ggplot2::geom_bar(fill = "#0073C2FF") + ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 45, hjust = 1)) num_plot= ggplot2::ggplot(data, ggplot2::aes(Count)) + ggplot2::geom_bar(fill = "#0073C2FF") print(obs_plot) print(sp_plot) print(num_plot)
The following section provides a table of all REPORTED NAVIGATIONAL transects in the data file. These are NOT checked against the design transects or stratification and should be used ONLY as an extra QA/QC step for the transcriber. Navigational transects are numbered incorrectly according to the design and get changed before any analysis.
trans=sort(unique(data$Transect)) trans %>% kableExtra::kable(format="html", col.names = c("Transect"), escape = F ) %>% kableExtra::kable_styling("bordered", full_width=FALSE, font_size = 14) %>% kableExtra::scroll_box(height = "250px")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.