A Reproducible Data Workflow



McCrea Cobb

Refuge Inventory and Monitoring
mccrea_cobb@fws.gov
mccrea-cobb

Emma Schillerstrom

Refuge Inventory and Monitoring
emma_shillerstrom@fws.gov
eschillerstrom-usfws

Jonah Withers

Fisheries and Ecological Services
jonah_withers@fws.gov
JonahWithers-USFWS



A Witch-proof Data Workflow

An image of a witch brewing reproducible data. Image was generate by ChatGPT.

McCrea Cobb

Refuge Inventory and Monitoring
mccrea_cobb@fws.gov
mccrea-cobb

Emma Schillerstrom

Refuge Inventory and Monitoring
emma_shillerstrom@fws.gov
eschillerstrom-usfws

Jonah Withers

Fisheries and Ecological Services
jonah_withers@fws.gov
JonahWithers-USFWS

Overview


  • What is a script-based workflow?
  • Advantages to using a script-based workflow?
  • Why choose ?
  • Our recommended workflow

What is a Script-Based Workflow?

Workflows: Manual Workflow

An image of cascading boxes showing proposed workflow with Project setup highlighted and pen, paper, and gps next to it pointing to microsoft access and excel icons.

An image of cascading boxes showing proposed workflow with Data Wrangling highlighted with an image of an arrow pointing in both directions to a pen and paper and microsoft access and excel icons.

An image of cascading boxes showing proposed workflow with Preserve Data highlighted with an image of the servcat and science base icons.

An image of cascading boxes showing proposed workflow with Anylsis highlighted with an image of a R icon and ArcGIS online icon.

An image of cascading boxes showing proposed workflow with Summarize Results highlighted with an image of microsoft access and excel icons, R icon, and ArcGIS online icon

An image of cascading boxes showing proposed workflow with Report highlighted with an image of microsoft word and power point icons.

An image of cascading boxes showing proposed workflow with Preserve Data highlighted with an image of the servcat and science base icons.

Workflows: Script-Based Workflow

An image of cascading boxes showing proposed workflow with R icons next to each step.

Why use Script-Based Workflow?

A witch-themed image with six scrolls. Each scroll is either labeled documented, reproducible, reduce errors, easily scaled, version control, or sharing. Image was generate by ChatGPT.

Why Choose ?

Why Choose ?


  • Open-source and free
  • Flexible
  • Widely used in ecology
  • Statistically powerful
  • Active community & tons of packages (21,590!)


A witch-themed image displaying the power of R and why to use it. Image was generate by ChatGPT.

Project Setup

A witch on the starting line with moose in the background. Image was generate by ChatGPT.

Create RStudio Project

Create RStudio Project


  • Root directory
  • Standard file paths
  • Self-contained, bundling
  • Version control
  • Collaboration


Image of witch themed letter R with files bundled inside it. Image was generate by ChatGPT.

Create R project


Manually

Image of Rstudio project setup window.


Using Code


library(makeProject)

makeProject(name = "myProject", 
            path = "C:/Users/jwithers/Presentations", 
            force = FALSE, 
            author = "Your Name", 
            email = "yourfault@somewhere.net")

Standardized File Structure

Image of witch-themed organized binders. Image was generate by ChatGPT.

Standardized File Structure

Why use a standardized file structure?


  • Easier to locate a file

  • Find similar files together

  • Reproducibility

  • Reduce risk of data loss

  • Moving files becomes much easier


  • Easy to identify where to store files

  • Keep organized in the long-run

  • Increases productivity

  • Projects can easily be understood by others

  • Consistency across projects

Standardized File Structure

What are some strategies for creating a good file structure?


  • Establish a system!

  • Develop naming convention

    • Short-descriptive names

    • Avoid special characters and spaces

  • Use folder hierarchy

    • Subfolders are your friend!
  • Use consistent pattern

  • Avoid overlapping categories

  • Don’t let folders get too deep

  • Document your system

  • Stick to the plan!

File Structure


  • Alaska Regional Data Repository 1


  • Alaska National Wildlife Refuges 2

Image of alaska regional data repository folder structure.

File Structure


Alaska Regional Data Repository 1

Image of Alaska Regional Data Repository File Structure.


Alaska National Wildlife Refuges 2

Image of Alaska Refuges program file structure.

File Structure: R




Code

library(refugetools)

create.dir(proj.name = "myProject", 
           dir.name = "C:/Users/jwithers/Presentations")

Resulting Folder Structure

Image of Alaska Refuges program file structure.

File Structure: README

Manually

Image of .txt file icon.

Dublin core

refugetools:::dublin(project = "myProject",
                     name = "jonah withers",
                     email = "jonah_withers@fws.gov",
                     office = "conservation genetics laboratory")


Markdown

# Hello, world!
#
# This is an example function named 'hello' 
# which prints 'Hello, world!'.
#
# You can learn more about package authoring with RStudio at:
#
#   https://r-pkgs.org
#
# Some useful keyboard shortcuts for package authoring:
#
#   Install Package:           'Ctrl + Shift + B'
#   Check Package:             'Ctrl + Shift + E'
#   Test Package:              'Ctrl + Shift + T'

hello <- function() {
  print("Hello, world!")
}

Version Control

Image of witch with multiple versions of files. Image was generate by ChatGPT.

Version Control


  • Manage and track changes
  • Provides documentation
  • Easily share and collaborate


Image of scanner in front of files shelves full of folders.

Version Control: Mannual Workflow


External hard drive

Image of external hard drive.


Sharepoint

Image of sharepoint file version control.


OneDrive

Image of OneDrive file version control.

Version Control: R Workflow


  • Seamless integration with GIT
  • Line-by-line tracking
  • Others may contribute
  • Package versioning (renv)



Image of r git commit preview.

Version Control

Github

Gitlab

Version Control: Github


Screenshot of US fish and wildlife service github webpage.


  • DOI GitHub Enterprise Cloud (DGEC) 1
  • USFWS Organizational Account 2
  • USFWS Github Guidance 3
  • Requires training
  • Must use if publishing source code

Version Control: GitLab


Screenshot of US fish and wildlife service gitlab account webpage.


  • USFWS user Gitlab account 1
  • Internal to DOI
  • All FWS staff have accounts

Starting a New Script

Witch creating r script. Image was generate by ChatGPT.

Starting a New Script


Basic documentation is as easy as a “#” (shortcut: CTRL-SHIFT-C)


# This script is meant to teach staff new to R about how to create comments in R scripts.
# Created by Jonah Withers
# Created on 20241031

# Any code or text that is commented will not be executed,
but if it is not commented, R will treat it as code,
so this will return an ERROR.


Human Readability Reusability

Starting a New Script


Stay organized with sections (shortcut: CTRL-SHIFT-R)


# This script is meant to teach staff new to R about how to create comments in R scripts.
# Created by Jonah Withers
# Created on 20241031

# Install packages --------------------------------------------------------
install.packages(c("tidyverse","readxl","janitor"))


RStudio script highlighting outline button.

Starting a New Script


Installing packages


# This script is meant to teach staff new to R about how to create comments in R scripts.
# Created by Jonah Withers
# Created on 20241031

# Install packages --------------------------------------------------------
install.packages(c("tidyverse","readxl","janitor"))


For non-CRAN packages use

# Install packages --------------------------------------------------------
devtools::install_github("author/package_name")

Starting a New Script


Use library() to load packages


# This script is meant to teach staff new to R about how to create comments in R scripts.
# Created by Jonah Withers
# Created on 20241031

# Install packages --------------------------------------------------------
install.packages(c("tidyverse","readxl","janitor"))

# Load packages -----------------------------------------------------------
library(tidyverse)
library(readxl)
library(janitor)

Break Time

Witch riding moose past ranger. Image was generate by ChatGPT.

The Tetlin Witch Project

The Survey

Site Map


Type: Annual occurrence survey

Logistics:

  • Completed over 8 days in August

  • Detection (0, 1) recorded at 100 sites/day

  • Conducted for 20 years at Tetlin NWR

Goal: Estimate probability of witch occurrence across the refuge

Witch Background

Do NOT like water

AI generated image of witch melting in water

DO favor forest

AI generated image of witch creating a magical broom stick in the woods of Alaska

Where We Are

Completed:

  • Data collection ✓

  • Data entry ✓

Next:

  • Data wrangling ☐

Screenshot of Excel workbook with 20 years/sheets of witch detection data at 100 sites on Tetlin NWR

Excel workbook with all years of data

Photos from the Field

Coming soon to your Wild Weekly…

 

AI generated image of a witch lurking in some woods

 

AI generated image of a witch with red eyes riding a scary, red-eyed moose through woods

 

AI generated image of a witch on a broomstick flying over Alaska mountains and watershed with Northern Lights in the sky

Data Wrangling

AI-generated image in claymation style of a witch sweeping up data-like tokens and looking at a computer screen with data and graphs on it

A data workflow flow chart with "Project Setup", "Data Wrangling", "Preserve Data", "Analyze", "Summarize Results", "Report", and "Preserve Products" connected unidirectionally by arrows, with the "Data Wrangling" box highlighted in yellow

What is Data Wrangling?

the process of transforming raw data into a usable form


Our Workflow:

  1. Importing Data ➝ Obtain

  2. Tidying Data ➝ Restructure

  3. Exploratory Data Analysis & Quality Control ➝ Clean, Correct, and Understand

black, messy, tangled, swirled doodle line that turns into a neat, white, swirled line, all on an orange background (sourced from: https://www.nciea.org/blog/data-data-everywhere-why-so-hard-to-use/)

Why Wrangle Data in R?

Limitations of

Manual Workflow

  • Messy

  • Prone to human error

  • Difficult to correct or reverse changes

  • Inefficient

  • Not reusable

Advantages of

Scripted Workflow

  • Can iterate through large datasets

  • Can manipulate data without overwriting it

  • Can easily undo or reapply changes

  • Changes are documented

  • Avoids repeating steps

  • Allows for automated workflows/pipelines

  • Eliminates future workload

Getting Started


✓ Created a new R project

✓ Set up a standard file directory structure

✓ Set up version control (optional, good practice)

✓ Initialized a new R script file (.R)

✓ Installed and loaded our packages


Time to get coding!

Data Wrangling: Importing


AI-generated image in claymation style of a witch using a computer and magically importing information onto it

Importing Data

Can read data from a…

  1. Locally stored file (.csv, .xlsx, etc.)

Example:

my_data <- read.csv("path/to/filename.csv")
  1. Online source (download link, API, ServCat, etc.)

Examples:

my_data <- read.csv(download.file("www.url.com","save_as_filename.csv"))
my_data <- GET(url = "api-url.com/input-id", body = list("parameter1","parameter2"))

Importing Data

Extra step: merge multiple tables, if necessary

#Join tables by common variables
all_data <- left_join(observation_data, site_data, join_by(c("lat", "lon")))

Suggestion

You can sometimes replace the need for MS Access databases through R scripts, depending on the functionality you desire. Using R to join related tables allows for automation and ensures your files are in an open format.

Witch Survey

Importing Our Data

Importing Our Data

Use read_excel() to import data from a specific sheet in a workbook

  • Set new “dataframe” as a variable
#Import raw data
witch_data <- read_excel("data/xlsx/witch_survey.xlsx", sheet = "2024")

Note

Variables are the basis of reusability!

Data Wrangling: Tidying


AI-generated image in claymation style of a witch at a desk organizing 3D numbers into rows

Tidy Data

 

Image with 3 subimages of datatables with captions showing that a data set is tidy iff: (1) each variabl is in its own column, (2) each observation is in its own row, and (3) each value is in its own cell

Why Tidy Data?


  • Standardization

  • Interpretability

  • Machine readability

  • Ease of use and reuse

  • Conducive to metadata

 

Graphic made by Hadley Wickham stating, "The standard structure of tidy data means that "tidy datasets are all alike... but every messy dataset is messy in its own way," with anthropomorphized cartoons of tidy and messy datasets

Witch Survey

Tidying Our Data

Tidying Our Data

Let’s take a peak at what we are working with:

Site Number Lon Lat 08/11/2024 08/12/2024 08/13/2024 08/14/2024 08/15/2024 08/16/2024 08/17/2024 08/18/2024
1 -141.3999 62.73481 0 0 0 0 0 0 0 none
2 -141.2218 62.60092 0 0 0 0 0 0 0 1
3 -141.1138 62.46664 0 0 0 0 0 0 0 0
4 -141.8892 62.65743 1 0 1 0 0 1 0 1
5 -141.2041 62.50272 0 0 1 1 0 1 0 0
6 -142.0298 63.06880 0 0 0 0 0 0 0 0

First few lines of dataset

Why is our data not tidy?

Answer: Some column names are values NOT variables

Tidying Our Data

Let’s use tidyverse to tidy our data in one line by “pivoting”

#Tidy data structure
tidy_data <- pivot_longer(witch_data, cols = starts_with("08"), names_to = "Date", values_to = "Presence", names_transform = list(Date = mdy), values_transform = list(Presence = as.character))

Updated dataframe:

Row Count: 800

Site Number Lon Lat Date Presence
1 -141.3999 62.73481 2024-08-11 0
1 -141.3999 62.73481 2024-08-12 0
1 -141.3999 62.73481 2024-08-13 0
1 -141.3999 62.73481 2024-08-14 0
1 -141.3999 62.73481 2024-08-15 0
1 -141.3999 62.73481 2024-08-16 0
1 -141.3999 62.73481 2024-08-17 0
1 -141.3999 62.73481 2024-08-18 none
2 -141.2218 62.60092 2024-08-11 0
2 -141.2218 62.60092 2024-08-12 0
2 -141.2218 62.60092 2024-08-13 0
2 -141.2218 62.60092 2024-08-14 0
2 -141.2218 62.60092 2024-08-15 0
2 -141.2218 62.60092 2024-08-16 0
2 -141.2218 62.60092 2024-08-17 0
2 -141.2218 62.60092 2024-08-18 1
3 -141.1138 62.46664 2024-08-11 0
3 -141.1138 62.46664 2024-08-12 0
3 -141.1138 62.46664 2024-08-13 0
3 -141.1138 62.46664 2024-08-14 0
3 -141.1138 62.46664 2024-08-15 0
3 -141.1138 62.46664 2024-08-16 0
3 -141.1138 62.46664 2024-08-17 0
3 -141.1138 62.46664 2024-08-18 0
4 -141.8892 62.65743 2024-08-11 1
4 -141.8892 62.65743 2024-08-12 0
4 -141.8892 62.65743 2024-08-13 1
4 -141.8892 62.65743 2024-08-14 0
4 -141.8892 62.65743 2024-08-15 0
4 -141.8892 62.65743 2024-08-16 1
4 -141.8892 62.65743 2024-08-17 0
4 -141.8892 62.65743 2024-08-18 1
5 -141.2041 62.50272 2024-08-11 0
5 -141.2041 62.50272 2024-08-12 0
5 -141.2041 62.50272 2024-08-13 1
5 -141.2041 62.50272 2024-08-14 1
5 -141.2041 62.50272 2024-08-15 0
5 -141.2041 62.50272 2024-08-16 1
5 -141.2041 62.50272 2024-08-17 0
5 -141.2041 62.50272 2024-08-18 0
6 -142.0298 63.06880 2024-08-11 0
6 -142.0298 63.06880 2024-08-12 0
6 -142.0298 63.06880 2024-08-13 0
6 -142.0298 63.06880 2024-08-14 0
6 -142.0298 63.06880 2024-08-15 0
6 -142.0298 63.06880 2024-08-16 0
6 -142.0298 63.06880 2024-08-17 0
6 -142.0298 63.06880 2024-08-18 0
7 -141.6778 62.54655 2024-08-11 0
7 -141.6778 62.54655 2024-08-12 0
7 -141.6778 62.54655 2024-08-13 0
7 -141.6778 62.54655 2024-08-14 0
7 -141.6778 62.54655 2024-08-15 0
7 -141.6778 62.54655 2024-08-16 0
7 -141.6778 62.54655 2024-08-17 0
7 -141.6778 62.54655 2024-08-18 0
8 -141.0126 62.43036 2024-08-11 1
8 -141.0126 62.43036 2024-08-12 0
8 -141.0126 62.43036 2024-08-13 0
8 -141.0126 62.43036 2024-08-14 1
8 -141.0126 62.43036 2024-08-15 1
8 -141.0126 62.43036 2024-08-16 0
8 -141.0126 62.43036 2024-08-17 0
8 -141.0126 62.43036 2024-08-18 0
9 -141.8592 62.72983 2024-08-11 0
9 -141.8592 62.72983 2024-08-12 0
9 -141.8592 62.72983 2024-08-13 0
9 -141.8592 62.72983 2024-08-14 0
9 -141.8592 62.72983 2024-08-15 0
9 -141.8592 62.72983 2024-08-16 0
9 -141.8592 62.72983 2024-08-17 0
9 -141.8592 62.72983 2024-08-18 0
10 -141.7650 62.78915 2024-08-11 0
10 -141.7650 62.78915 2024-08-12 0
10 -141.7650 62.78915 2024-08-13 0
10 -141.7650 62.78915 2024-08-14 0
10 -141.7650 62.78915 2024-08-15 0
10 -141.7650 62.78915 2024-08-16 0
10 -141.7650 62.78915 2024-08-17 0
10 -141.7650 62.78915 2024-08-18 0
11 -141.3865 62.61024 2024-08-11 0
11 -141.3865 62.61024 2024-08-12 0
11 -141.3865 62.61024 2024-08-13 0
11 -141.3865 62.61024 2024-08-14 0
11 -141.3865 62.61024 2024-08-15 0
11 -141.3865 62.61024 2024-08-16 0
11 -141.3865 62.61024 2024-08-17 0
11 -141.3865 62.61024 2024-08-18 0
12 -142.4754 62.65598 2024-08-11 1
12 -142.4754 62.65598 2024-08-12 none
12 -142.4754 62.65598 2024-08-13 1
12 -142.4754 62.65598 2024-08-14 0
12 -142.4754 62.65598 2024-08-15 0
12 -142.4754 62.65598 2024-08-16 0
12 -142.4754 62.65598 2024-08-17 1
12 -142.4754 62.65598 2024-08-18 1
13 -142.2840 62.53903 2024-08-11 1
13 -142.2840 62.53903 2024-08-12 1
13 -142.2840 62.53903 2024-08-13 0
13 -142.2840 62.53903 2024-08-14 0
13 -142.2840 62.53903 2024-08-15 1
13 -142.2840 62.53903 2024-08-16 1
13 -142.2840 62.53903 2024-08-17 6
13 -142.2840 62.53903 2024-08-18 1
14 -142.0061 62.64842 2024-08-11 1
14 -142.0061 62.64842 2024-08-12 1
14 -142.0061 62.64842 2024-08-13 1
14 -142.0061 62.64842 2024-08-14 1
14 -142.0061 62.64842 2024-08-15 1
14 -142.0061 62.64842 2024-08-16 1
14 -142.0061 62.64842 2024-08-17 0
14 -142.0061 62.64842 2024-08-18 1
15 -141.4657 62.51736 2024-08-11 0
15 -141.4657 62.51736 2024-08-12 0
15 -141.4657 62.51736 2024-08-13 0
15 -141.4657 62.51736 2024-08-14 0
15 -141.4657 62.51736 2024-08-15 0
15 -141.4657 62.51736 2024-08-16 1
15 -141.4657 62.51736 2024-08-17 0
15 -141.4657 62.51736 2024-08-18 1
16 -142.1781 62.60028 2024-08-11 0
16 -142.1781 62.60028 2024-08-12 0
16 -142.1781 62.60028 2024-08-13 1
16 -142.1781 62.60028 2024-08-14 0
16 -142.1781 62.60028 2024-08-15 0
16 -142.1781 62.60028 2024-08-16 0
16 -142.1781 62.60028 2024-08-17 1
16 -142.1781 62.60028 2024-08-18 1
17 -142.3663 62.72883 2024-08-11 0
17 -142.3663 62.72883 2024-08-12 0
17 -142.3663 62.72883 2024-08-13 0
17 -142.3663 62.72883 2024-08-14 0
17 -142.3663 62.72883 2024-08-15 0
17 -142.3663 62.72883 2024-08-16 0
17 -142.3663 62.72883 2024-08-17 0
17 -142.3663 62.72883 2024-08-18 0
18 -141.3504 62.60356 2024-08-11 0
18 -141.3504 62.60356 2024-08-12 0
18 -141.3504 62.60356 2024-08-13 0
18 -141.3504 62.60356 2024-08-14 0
18 -141.3504 62.60356 2024-08-15 0
18 -141.3504 62.60356 2024-08-16 0
18 -141.3504 62.60356 2024-08-17 0
18 -141.3504 62.60356 2024-08-18 0
19 -142.0389 62.91487 2024-08-11 0
19 -142.0389 62.91487 2024-08-12 0
19 -142.0389 62.91487 2024-08-13 0
19 -142.0389 62.91487 2024-08-14 0
19 -142.0389 62.91487 2024-08-15 0
19 -142.0389 62.91487 2024-08-16 0
19 -142.0389 62.91487 2024-08-17 0
19 -142.0389 62.91487 2024-08-18 0
20 -141.3590 62.53079 2024-08-11 0
20 -141.3590 62.53079 2024-08-12 0
20 -141.3590 62.53079 2024-08-13 0
20 -141.3590 62.53079 2024-08-14 0
20 -141.3590 62.53079 2024-08-15 0
20 -141.3590 62.53079 2024-08-16 0
20 -141.3590 62.53079 2024-08-17 0
20 -141.3590 62.53079 2024-08-18 0
21 -142.0552 62.55160 2024-08-11 0
21 -142.0552 62.55160 2024-08-12 0
21 -142.0552 62.55160 2024-08-13 0
21 -142.0552 62.55160 2024-08-14 0
21 -142.0552 62.55160 2024-08-15 0
21 -142.0552 62.55160 2024-08-16 0
21 -142.0552 62.55160 2024-08-17 1
21 -142.0552 62.55160 2024-08-18 0
22 -141.9885 62.67760 2024-08-11 0
22 -141.9885 62.67760 2024-08-12 0
22 -141.9885 62.67760 2024-08-13 0
22 -141.9885 62.67760 2024-08-14 0
22 -141.9885 62.67760 2024-08-15 0
22 -141.9885 62.67760 2024-08-16 0
22 -141.9885 62.67760 2024-08-17 0
22 -141.9885 62.67760 2024-08-18 0
23 -142.1681 62.53650 2024-08-11 0
23 -142.1681 62.53650 2024-08-12 6
23 -142.1681 62.53650 2024-08-13 0
23 -142.1681 62.53650 2024-08-14 0
23 -142.1681 62.53650 2024-08-15 0
23 -142.1681 62.53650 2024-08-16 0
23 -142.1681 62.53650 2024-08-17 0
23 -142.1681 62.53650 2024-08-18 0
24 -141.7300 62.57494 2024-08-11 0
24 -141.7300 62.57494 2024-08-12 0
24 -141.7300 62.57494 2024-08-13 0
24 -141.7300 62.57494 2024-08-14 0
24 -141.7300 62.57494 2024-08-15 0
24 -141.7300 62.57494 2024-08-16 0
24 -141.7300 62.57494 2024-08-17 0
24 -141.7300 62.57494 2024-08-18 0
25 -142.2208 63.13285 2024-08-11 1
25 -142.2208 63.13285 2024-08-12 0
25 -142.2208 63.13285 2024-08-13 1
25 -142.2208 63.13285 2024-08-14 1
25 -142.2208 63.13285 2024-08-15 0
25 -142.2208 63.13285 2024-08-16 1
25 -142.2208 63.13285 2024-08-17 0
25 -142.2208 63.13285 2024-08-18 1
26 -142.6733 62.66561 2024-08-11 0
26 -142.6733 62.66561 2024-08-12 0
26 -142.6733 62.66561 2024-08-13 1
26 -142.6733 62.66561 2024-08-14 6
26 -142.6733 62.66561 2024-08-15 1
26 -142.6733 62.66561 2024-08-16 0
26 -142.6733 62.66561 2024-08-17 1
26 -142.6733 62.66561 2024-08-18 1
27 -142.4242 62.70909 2024-08-11 0
27 -142.4242 62.70909 2024-08-12 0
27 -142.4242 62.70909 2024-08-13 1
27 -142.4242 62.70909 2024-08-14 0
27 -142.4242 62.70909 2024-08-15 1
27 -142.4242 62.70909 2024-08-16 0
27 -142.4242 62.70909 2024-08-17 1
27 -142.4242 62.70909 2024-08-18 0
28 -142.0969 62.57538 2024-08-11 0
28 -142.0969 62.57538 2024-08-12 1
28 -142.0969 62.57538 2024-08-13 0
28 -142.0969 62.57538 2024-08-14 1
28 -142.0969 62.57538 2024-08-15 0
28 -142.0969 62.57538 2024-08-16 0
28 -142.0969 62.57538 2024-08-17 0
28 -142.0969 62.57538 2024-08-18 1
29 -141.2029 62.69294 2024-08-11 1
29 -141.2029 62.69294 2024-08-12 0
29 -141.2029 62.69294 2024-08-13 0
29 -141.2029 62.69294 2024-08-14 0
29 -141.2029 62.69294 2024-08-15 1
29 -141.2029 62.69294 2024-08-16 1
29 -141.2029 62.69294 2024-08-17 0
29 -141.2029 62.69294 2024-08-18 0
30 -141.6473 62.58755 2024-08-11 1
30 -141.6473 62.58755 2024-08-12 0
30 -141.6473 62.58755 2024-08-13 1
30 -141.6473 62.58755 2024-08-14 1
30 -141.6473 62.58755 2024-08-15 1
30 -141.6473 62.58755 2024-08-16 0
30 -141.6473 62.58755 2024-08-17 0
30 -141.6473 62.58755 2024-08-18 1
31 -142.2798 62.66613 2024-08-11 0
31 -142.2798 62.66613 2024-08-12 0
31 -142.2798 62.66613 2024-08-13 1
31 -142.2798 62.66613 2024-08-14 0
31 -142.2798 62.66613 2024-08-15 1
31 -142.2798 62.66613 2024-08-16 0
31 -142.2798 62.66613 2024-08-17 1
31 -142.2798 62.66613 2024-08-18 0
32 -142.0045 62.71652 2024-08-11 0
32 -142.0045 62.71652 2024-08-12 1
32 -142.0045 62.71652 2024-08-13 7
32 -142.0045 62.71652 2024-08-14 0
32 -142.0045 62.71652 2024-08-15 1
32 -142.0045 62.71652 2024-08-16 0
32 -142.0045 62.71652 2024-08-17 0
32 -142.0045 62.71652 2024-08-18 1
33 -141.7540 62.84694 2024-08-11 0
33 -141.7540 62.84694 2024-08-12 0
33 -141.7540 62.84694 2024-08-13 1
33 -141.7540 62.84694 2024-08-14 1
33 -141.7540 62.84694 2024-08-15 0
33 -141.7540 62.84694 2024-08-16 1
33 -141.7540 62.84694 2024-08-17 0
33 -141.7540 62.84694 2024-08-18 0
34 -142.2564 63.14666 2024-08-11 0
34 -142.2564 63.14666 2024-08-12 0
34 -142.2564 63.14666 2024-08-13 0
34 -142.2564 63.14666 2024-08-14 0
34 -142.2564 63.14666 2024-08-15 0
34 -142.2564 63.14666 2024-08-16 0
34 -142.2564 63.14666 2024-08-17 0
34 -142.2564 63.14666 2024-08-18 0
35 -141.9635 62.56904 2024-08-11 0
35 -141.9635 62.56904 2024-08-12 1
35 -141.9635 62.56904 2024-08-13 1
35 -141.9635 62.56904 2024-08-14 1
35 -141.9635 62.56904 2024-08-15 1
35 -141.9635 62.56904 2024-08-16 1
35 -141.9635 62.56904 2024-08-17 0
35 -141.9635 62.56904 2024-08-18 0
36 -141.0874 62.64522 2024-08-11 0
36 -141.0874 62.64522 2024-08-12 0
36 -141.0874 62.64522 2024-08-13 0
36 -141.0874 62.64522 2024-08-14 0
36 -141.0874 62.64522 2024-08-15 0
36 -141.0874 62.64522 2024-08-16 0
36 -141.0874 62.64522 2024-08-17 0
36 -141.0874 62.64522 2024-08-18 0
37 -141.2080 62.58882 2024-08-11 0
37 -141.2080 62.58882 2024-08-12 6
37 -141.2080 62.58882 2024-08-13 1
37 -141.2080 62.58882 2024-08-14 0
37 -141.2080 62.58882 2024-08-15 0
37 -141.2080 62.58882 2024-08-16 1
37 -141.2080 62.58882 2024-08-17 0
37 -141.2080 62.58882 2024-08-18 0
38 -141.7376 62.65630 2024-08-11 0
38 -141.7376 62.65630 2024-08-12 0
38 -141.7376 62.65630 2024-08-13 0
38 -141.7376 62.65630 2024-08-14 0
38 -141.7376 62.65630 2024-08-15 0
38 -141.7376 62.65630 2024-08-16 0
38 -141.7376 62.65630 2024-08-17 0
38 -141.7376 62.65630 2024-08-18 0
39 -141.1235 62.50640 2024-08-11 0
39 -141.1235 62.50640 2024-08-12 0
39 -141.1235 62.50640 2024-08-13 0
39 -141.1235 62.50640 2024-08-14 0
39 -141.1235 62.50640 2024-08-15 0
39 -141.1235 62.50640 2024-08-16 0
39 -141.1235 62.50640 2024-08-17 0
39 -141.1235 62.50640 2024-08-18 0
40 -142.3158 62.61169 2024-08-11 0
40 -142.3158 62.61169 2024-08-12 0
40 -142.3158 62.61169 2024-08-13 6
40 -142.3158 62.61169 2024-08-14 0
40 -142.3158 62.61169 2024-08-15 0
40 -142.3158 62.61169 2024-08-16 0
40 -142.3158 62.61169 2024-08-17 0
40 -142.3158 62.61169 2024-08-18 0
41 -142.7681 62.63603 2024-08-11 1
41 -142.7681 62.63603 2024-08-12 1
41 -142.7681 62.63603 2024-08-13 1
41 -142.7681 62.63603 2024-08-14 1
41 -142.7681 62.63603 2024-08-15 1
41 -142.7681 62.63603 2024-08-16 1
41 -142.7681 62.63603 2024-08-17 1
41 -142.7681 62.63603 2024-08-18 1
42 -141.1001 62.50299 2024-08-11 0
42 -141.1001 62.50299 2024-08-12 1
42 -141.1001 62.50299 2024-08-13 0
42 -141.1001 62.50299 2024-08-14 0
42 -141.1001 62.50299 2024-08-15 1
42 -141.1001 62.50299 2024-08-16 1
42 -141.1001 62.50299 2024-08-17 0
42 -141.1001 62.50299 2024-08-18 0
43 -141.5272 62.51619 2024-08-11 0
43 -141.5272 62.51619 2024-08-12 0
43 -141.5272 62.51619 2024-08-13 0
43 -141.5272 62.51619 2024-08-14 0
43 -141.5272 62.51619 2024-08-15 0
43 -141.5272 62.51619 2024-08-16 0
43 -141.5272 62.51619 2024-08-17 0
43 -141.5272 62.51619 2024-08-18 0
44 -141.0882 62.53120 2024-08-11 0
44 -141.0882 62.53120 2024-08-12 0
44 -141.0882 62.53120 2024-08-13 none
44 -141.0882 62.53120 2024-08-14 0
44 -141.0882 62.53120 2024-08-15 0
44 -141.0882 62.53120 2024-08-16 0
44 -141.0882 62.53120 2024-08-17 0
44 -141.0882 62.53120 2024-08-18 0
45 -141.6640 62.73446 2024-08-11 0
45 -141.6640 62.73446 2024-08-12 0
45 -141.6640 62.73446 2024-08-13 0
45 -141.6640 62.73446 2024-08-14 0
45 -141.6640 62.73446 2024-08-15 0
45 -141.6640 62.73446 2024-08-16 0
45 -141.6640 62.73446 2024-08-17 0
45 -141.6640 62.73446 2024-08-18 0
46 -142.1875 62.69018 2024-08-11 0
46 -142.1875 62.69018 2024-08-12 0
46 -142.1875 62.69018 2024-08-13 0
46 -142.1875 62.69018 2024-08-14 0
46 -142.1875 62.69018 2024-08-15 0
46 -142.1875 62.69018 2024-08-16 0
46 -142.1875 62.69018 2024-08-17 0
46 -142.1875 62.69018 2024-08-18 0
47 -142.5923 62.67256 2024-08-11 0
47 -142.5923 62.67256 2024-08-12 0
47 -142.5923 62.67256 2024-08-13 0
47 -142.5923 62.67256 2024-08-14 0
47 -142.5923 62.67256 2024-08-15 0
47 -142.5923 62.67256 2024-08-16 1
47 -142.5923 62.67256 2024-08-17 1
47 -142.5923 62.67256 2024-08-18 1
48 -142.6154 62.59250 2024-08-11 1
48 -142.6154 62.59250 2024-08-12 0
48 -142.6154 62.59250 2024-08-13 1
48 -142.6154 62.59250 2024-08-14 1
48 -142.6154 62.59250 2024-08-15 1
48 -142.6154 62.59250 2024-08-16 1
48 -142.6154 62.59250 2024-08-17 0
48 -142.6154 62.59250 2024-08-18 1
49 -141.7178 62.64036 2024-08-11 0
49 -141.7178 62.64036 2024-08-12 0
49 -141.7178 62.64036 2024-08-13 0
49 -141.7178 62.64036 2024-08-14 0
49 -141.7178 62.64036 2024-08-15 0
49 -141.7178 62.64036 2024-08-16 0
49 -141.7178 62.64036 2024-08-17 0
49 -141.7178 62.64036 2024-08-18 0
50 -141.2061 62.57432 2024-08-11 0
50 -141.2061 62.57432 2024-08-12 0
50 -141.2061 62.57432 2024-08-13 0
50 -141.2061 62.57432 2024-08-14 0
50 -141.2061 62.57432 2024-08-15 0
50 -141.2061 62.57432 2024-08-16 0
50 -141.2061 62.57432 2024-08-17 0
50 -141.2061 62.57432 2024-08-18 0
51 -141.4963 62.67632 2024-08-11 0
51 -141.4963 62.67632 2024-08-12 0
51 -141.4963 62.67632 2024-08-13 0
51 -141.4963 62.67632 2024-08-14 0
51 -141.4963 62.67632 2024-08-15 0
51 -141.4963 62.67632 2024-08-16 1
51 -141.4963 62.67632 2024-08-17 1
51 -141.4963 62.67632 2024-08-18 1
52 -141.9023 62.80006 2024-08-11 0
52 -141.9023 62.80006 2024-08-12 0
52 -141.9023 62.80006 2024-08-13 0
52 -141.9023 62.80006 2024-08-14 0
52 -141.9023 62.80006 2024-08-15 0
52 -141.9023 62.80006 2024-08-16 0
52 -141.9023 62.80006 2024-08-17 0
52 -141.9023 62.80006 2024-08-18 0
53 -142.0560 62.67649 2024-08-11 0
53 -142.0560 62.67649 2024-08-12 0
53 -142.0560 62.67649 2024-08-13 0
53 -142.0560 62.67649 2024-08-14 0
53 -142.0560 62.67649 2024-08-15 0
53 -142.0560 62.67649 2024-08-16 0
53 -142.0560 62.67649 2024-08-17 0
53 -142.0560 62.67649 2024-08-18 0
54 -141.2976 62.54956 2024-08-11 0
54 -141.2976 62.54956 2024-08-12 0
54 -141.2976 62.54956 2024-08-13 0
54 -141.2976 62.54956 2024-08-14 1
54 -141.2976 62.54956 2024-08-15 1
54 -141.2976 62.54956 2024-08-16 0
54 -141.2976 62.54956 2024-08-17 1
54 -141.2976 62.54956 2024-08-18 0
55 -142.4202 62.68249 2024-08-11 1
55 -142.4202 62.68249 2024-08-12 1
55 -142.4202 62.68249 2024-08-13 0
55 -142.4202 62.68249 2024-08-14 0
55 -142.4202 62.68249 2024-08-15 1
55 -142.4202 62.68249 2024-08-16 1
55 -142.4202 62.68249 2024-08-17 1
55 -142.4202 62.68249 2024-08-18 0
56 -141.9467 62.90643 2024-08-11 0
56 -141.9467 62.90643 2024-08-12 1
56 -141.9467 62.90643 2024-08-13 0
56 -141.9467 62.90643 2024-08-14 0
56 -141.9467 62.90643 2024-08-15 1
56 -141.9467 62.90643 2024-08-16 1
56 -141.9467 62.90643 2024-08-17 0
56 -141.9467 62.90643 2024-08-18 0
57 -142.1489 62.55010 2024-08-11 0
57 -142.1489 62.55010 2024-08-12 0
57 -142.1489 62.55010 2024-08-13 1
57 -142.1489 62.55010 2024-08-14 1
57 -142.1489 62.55010 2024-08-15 1
57 -142.1489 62.55010 2024-08-16 0
57 -142.1489 62.55010 2024-08-17 1
57 -142.1489 62.55010 2024-08-18 1
58 -141.8068 62.64582 2024-08-11 0
58 -141.8068 62.64582 2024-08-12 0
58 -141.8068 62.64582 2024-08-13 0
58 -141.8068 62.64582 2024-08-14 0
58 -141.8068 62.64582 2024-08-15 0
58 -141.8068 62.64582 2024-08-16 0
58 -141.8068 62.64582 2024-08-17 0
58 -141.8068 62.64582 2024-08-18 0
59 -142.4724 62.55352 2024-08-11 0
59 -142.4724 62.55352 2024-08-12 0
59 -142.4724 62.55352 2024-08-13 0
59 -142.4724 62.55352 2024-08-14 0
59 -142.4724 62.55352 2024-08-15 0
59 -142.4724 62.55352 2024-08-16 0
59 -142.4724 62.55352 2024-08-17 0
59 -142.4724 62.55352 2024-08-18 0
60 -142.1777 62.53906 2024-08-11 0
60 -142.1777 62.53906 2024-08-12 0
60 -142.1777 62.53906 2024-08-13 0
60 -142.1777 62.53906 2024-08-14 0
60 -142.1777 62.53906 2024-08-15 0
60 -142.1777 62.53906 2024-08-16 0
60 -142.1777 62.53906 2024-08-17 0
60 -142.1777 62.53906 2024-08-18 0
61 -142.2139 62.70496 2024-08-11 1
61 -142.2139 62.70496 2024-08-12 0
61 -142.2139 62.70496 2024-08-13 1
61 -142.2139 62.70496 2024-08-14 1
61 -142.2139 62.70496 2024-08-15 1
61 -142.2139 62.70496 2024-08-16 0
61 -142.2139 62.70496 2024-08-17 1
61 -142.2139 62.70496 2024-08-18 0
62 -142.4665 62.69845 2024-08-11 0
62 -142.4665 62.69845 2024-08-12 0
62 -142.4665 62.69845 2024-08-13 0
62 -142.4665 62.69845 2024-08-14 0
62 -142.4665 62.69845 2024-08-15 0
62 -142.4665 62.69845 2024-08-16 0
62 -142.4665 62.69845 2024-08-17 0
62 -142.4665 62.69845 2024-08-18 0
63 -142.1061 62.61243 2024-08-11 0
63 -142.1061 62.61243 2024-08-12 0
63 -142.1061 62.61243 2024-08-13 0
63 -142.1061 62.61243 2024-08-14 0
63 -142.1061 62.61243 2024-08-15 0
63 -142.1061 62.61243 2024-08-16 0
63 -142.1061 62.61243 2024-08-17 0
63 -142.1061 62.61243 2024-08-18 0
64 -141.6977 62.60935 2024-08-11 1
64 -141.6977 62.60935 2024-08-12 2
64 -141.6977 62.60935 2024-08-13 1
64 -141.6977 62.60935 2024-08-14 0
64 -141.6977 62.60935 2024-08-15 0
64 -141.6977 62.60935 2024-08-16 1
64 -141.6977 62.60935 2024-08-17 0
64 -141.6977 62.60935 2024-08-18 1
65 -141.6256 62.54520 2024-08-11 0
65 -141.6256 62.54520 2024-08-12 0
65 -141.6256 62.54520 2024-08-13 0
65 -141.6256 62.54520 2024-08-14 0
65 -141.6256 62.54520 2024-08-15 0
65 -141.6256 62.54520 2024-08-16 0
65 -141.6256 62.54520 2024-08-17 0
65 -141.6256 62.54520 2024-08-18 0
66 -141.7201 62.52154 2024-08-11 0
66 -141.7201 62.52154 2024-08-12 1
66 -141.7201 62.52154 2024-08-13 0
66 -141.7201 62.52154 2024-08-14 1
66 -141.7201 62.52154 2024-08-15 0
66 -141.7201 62.52154 2024-08-16 1
66 -141.7201 62.52154 2024-08-17 1
66 -141.7201 62.52154 2024-08-18 1
67 -141.8860 62.76659 2024-08-11 0
67 -141.8860 62.76659 2024-08-12 0
67 -141.8860 62.76659 2024-08-13 0
67 -141.8860 62.76659 2024-08-14 0
67 -141.8860 62.76659 2024-08-15 0
67 -141.8860 62.76659 2024-08-16 0
67 -141.8860 62.76659 2024-08-17 0
67 -141.8860 62.76659 2024-08-18 0
68 -141.7883 62.55334 2024-08-11 0
68 -141.7883 62.55334 2024-08-12 0
68 -141.7883 62.55334 2024-08-13 0
68 -141.7883 62.55334 2024-08-14 0
68 -141.7883 62.55334 2024-08-15 0
68 -141.7883 62.55334 2024-08-16 0
68 -141.7883 62.55334 2024-08-17 0
68 -141.7883 62.55334 2024-08-18 0
69 -142.2948 62.63621 2024-08-11 1
69 -142.2948 62.63621 2024-08-12 0
69 -142.2948 62.63621 2024-08-13 0
69 -142.2948 62.63621 2024-08-14 0
69 -142.2948 62.63621 2024-08-15 1
69 -142.2948 62.63621 2024-08-16 1
69 -142.2948 62.63621 2024-08-17 1
69 -142.2948 62.63621 2024-08-18 0
70 -141.5504 62.60422 2024-08-11 0
70 -141.5504 62.60422 2024-08-12 0
70 -141.5504 62.60422 2024-08-13 0
70 -141.5504 62.60422 2024-08-14 0
70 -141.5504 62.60422 2024-08-15 0
70 -141.5504 62.60422 2024-08-16 0
70 -141.5504 62.60422 2024-08-17 0
70 -141.5504 62.60422 2024-08-18 0
71 -141.7647 62.64571 2024-08-11 0
71 -141.7647 62.64571 2024-08-12 0
71 -141.7647 62.64571 2024-08-13 0
71 -141.7647 62.64571 2024-08-14 0
71 -141.7647 62.64571 2024-08-15 0
71 -141.7647 62.64571 2024-08-16 0
71 -141.7647 62.64571 2024-08-17 0
71 -141.7647 62.64571 2024-08-18 0
72 -141.1197 62.59413 2024-08-11 0
72 -141.1197 62.59413 2024-08-12 1
72 -141.1197 62.59413 2024-08-13 0
72 -141.1197 62.59413 2024-08-14 0
72 -141.1197 62.59413 2024-08-15 7
72 -141.1197 62.59413 2024-08-16 0
72 -141.1197 62.59413 2024-08-17 0
72 -141.1197 62.59413 2024-08-18 1
73 -142.1173 62.59249 2024-08-11 0
73 -142.1173 62.59249 2024-08-12 0
73 -142.1173 62.59249 2024-08-13 0
73 -142.1173 62.59249 2024-08-14 0
73 -142.1173 62.59249 2024-08-15 1
73 -142.1173 62.59249 2024-08-16 0
73 -142.1173 62.59249 2024-08-17 0
73 -142.1173 62.59249 2024-08-18 0
74 -142.5958 62.66533 2024-08-11 0
74 -142.5958 62.66533 2024-08-12 0
74 -142.5958 62.66533 2024-08-13 0
74 -142.5958 62.66533 2024-08-14 1
74 -142.5958 62.66533 2024-08-15 1
74 -142.5958 62.66533 2024-08-16 1
74 -142.5958 62.66533 2024-08-17 0
74 -142.5958 62.66533 2024-08-18 0
75 -141.0726 62.51452 2024-08-11 1
75 -141.0726 62.51452 2024-08-12 1
75 -141.0726 62.51452 2024-08-13 0
75 -141.0726 62.51452 2024-08-14 0
75 -141.0726 62.51452 2024-08-15 1
75 -141.0726 62.51452 2024-08-16 0
75 -141.0726 62.51452 2024-08-17 1
75 -141.0726 62.51452 2024-08-18 0
76 -141.7515 62.52386 2024-08-11 0
76 -141.7515 62.52386 2024-08-12 0
76 -141.7515 62.52386 2024-08-13 0
76 -141.7515 62.52386 2024-08-14 0
76 -141.7515 62.52386 2024-08-15 0
76 -141.7515 62.52386 2024-08-16 0
76 -141.7515 62.52386 2024-08-17 0
76 -141.7515 62.52386 2024-08-18 0
77 -142.1253 62.76092 2024-08-11 0
77 -142.1253 62.76092 2024-08-12 0
77 -142.1253 62.76092 2024-08-13 0
77 -142.1253 62.76092 2024-08-14 0
77 -142.1253 62.76092 2024-08-15 0
77 -142.1253 62.76092 2024-08-16 0
77 -142.1253 62.76092 2024-08-17 0
77 -142.1253 62.76092 2024-08-18 0
78 -142.4756 62.62231 2024-08-11 0
78 -142.4756 62.62231 2024-08-12 6
78 -142.4756 62.62231 2024-08-13 0
78 -142.4756 62.62231 2024-08-14 0
78 -142.4756 62.62231 2024-08-15 0
78 -142.4756 62.62231 2024-08-16 0
78 -142.4756 62.62231 2024-08-17 0
78 -142.4756 62.62231 2024-08-18 0
79 -142.2206 62.70145 2024-08-11 0
79 -142.2206 62.70145 2024-08-12 1
79 -142.2206 62.70145 2024-08-13 1
79 -142.2206 62.70145 2024-08-14 0
79 -142.2206 62.70145 2024-08-15 2
79 -142.2206 62.70145 2024-08-16 1
79 -142.2206 62.70145 2024-08-17 1
79 -142.2206 62.70145 2024-08-18 0
80 -142.1133 62.71157 2024-08-11 0
80 -142.1133 62.71157 2024-08-12 1
80 -142.1133 62.71157 2024-08-13 1
80 -142.1133 62.71157 2024-08-14 1
80 -142.1133 62.71157 2024-08-15 0
80 -142.1133 62.71157 2024-08-16 0
80 -142.1133 62.71157 2024-08-17 0
80 -142.1133 62.71157 2024-08-18 1
81 -141.3385 62.64906 2024-08-11 0
81 -141.3385 62.64906 2024-08-12 0
81 -141.3385 62.64906 2024-08-13 0
81 -141.3385 62.64906 2024-08-14 0
81 -141.3385 62.64906 2024-08-15 0
81 -141.3385 62.64906 2024-08-16 0
81 -141.3385 62.64906 2024-08-17 0
81 -141.3385 62.64906 2024-08-18 0
82 -141.1544 62.48648 2024-08-11 0
82 -141.1544 62.48648 2024-08-12 0
82 -141.1544 62.48648 2024-08-13 0
82 -141.1544 62.48648 2024-08-14 1
82 -141.1544 62.48648 2024-08-15 0
82 -141.1544 62.48648 2024-08-16 0
82 -141.1544 62.48648 2024-08-17 0
82 -141.1544 62.48648 2024-08-18 0
83 -142.3510 62.71079 2024-08-11 0
83 -142.3510 62.71079 2024-08-12 0
83 -142.3510 62.71079 2024-08-13 0
83 -142.3510 62.71079 2024-08-14 0
83 -142.3510 62.71079 2024-08-15 0
83 -142.3510 62.71079 2024-08-16 0
83 -142.3510 62.71079 2024-08-17 0
83 -142.3510 62.71079 2024-08-18 0
84 -141.0750 62.56332 2024-08-11 0
84 -141.0750 62.56332 2024-08-12 0
84 -141.0750 62.56332 2024-08-13 0
84 -141.0750 62.56332 2024-08-14 0
84 -141.0750 62.56332 2024-08-15 0
84 -141.0750 62.56332 2024-08-16 0
84 -141.0750 62.56332 2024-08-17 0
84 -141.0750 62.56332 2024-08-18 0
85 -142.1391 62.69176 2024-08-11 0
85 -142.1391 62.69176 2024-08-12 1
85 -142.1391 62.69176 2024-08-13 0
85 -142.1391 62.69176 2024-08-14 1
85 -142.1391 62.69176 2024-08-15 1
85 -142.1391 62.69176 2024-08-16 1
85 -142.1391 62.69176 2024-08-17 1
85 -142.1391 62.69176 2024-08-18 0
86 -142.0767 62.55840 2024-08-11 0
86 -142.0767 62.55840 2024-08-12 0
86 -142.0767 62.55840 2024-08-13 1
86 -142.0767 62.55840 2024-08-14 0
86 -142.0767 62.55840 2024-08-15 0
86 -142.0767 62.55840 2024-08-16 0
86 -142.0767 62.55840 2024-08-17 0
86 -142.0767 62.55840 2024-08-18 1
87 -141.8629 62.78132 2024-08-11 0
87 -141.8629 62.78132 2024-08-12 0
87 -141.8629 62.78132 2024-08-13 0
87 -141.8629 62.78132 2024-08-14 0
87 -141.8629 62.78132 2024-08-15 0
87 -141.8629 62.78132 2024-08-16 0
87 -141.8629 62.78132 2024-08-17 0
87 -141.8629 62.78132 2024-08-18 0
88 -142.5104 62.66011 2024-08-11 0
88 -142.5104 62.66011 2024-08-12 0
88 -142.5104 62.66011 2024-08-13 0
88 -142.5104 62.66011 2024-08-14 0
88 -142.5104 62.66011 2024-08-15 0
88 -142.5104 62.66011 2024-08-16 0
88 -142.5104 62.66011 2024-08-17 0
88 -142.5104 62.66011 2024-08-18 0
89 -141.3179 62.71018 2024-08-11 1
89 -141.3179 62.71018 2024-08-12 1
89 -141.3179 62.71018 2024-08-13 0
89 -141.3179 62.71018 2024-08-14 1
89 -141.3179 62.71018 2024-08-15 1
89 -141.3179 62.71018 2024-08-16 1
89 -141.3179 62.71018 2024-08-17 0
89 -141.3179 62.71018 2024-08-18 0
90 -142.5948 62.66875 2024-08-11 0
90 -142.5948 62.66875 2024-08-12 1
90 -142.5948 62.66875 2024-08-13 0
90 -142.5948 62.66875 2024-08-14 1
90 -142.5948 62.66875 2024-08-15 1
90 -142.5948 62.66875 2024-08-16 0
90 -142.5948 62.66875 2024-08-17 1
90 -142.5948 62.66875 2024-08-18 0
91 -141.3715 62.45315 2024-08-11 1
91 -141.3715 62.45315 2024-08-12 0
91 -141.3715 62.45315 2024-08-13 1
91 -141.3715 62.45315 2024-08-14 0
91 -141.3715 62.45315 2024-08-15 0
91 -141.3715 62.45315 2024-08-16 1
91 -141.3715 62.45315 2024-08-17 0
91 -141.3715 62.45315 2024-08-18 1
92 -141.8540 62.83199 2024-08-11 0
92 -141.8540 62.83199 2024-08-12 0
92 -141.8540 62.83199 2024-08-13 0
92 -141.8540 62.83199 2024-08-14 0
92 -141.8540 62.83199 2024-08-15 0
92 -141.8540 62.83199 2024-08-16 0
92 -141.8540 62.83199 2024-08-17 0
92 -141.8540 62.83199 2024-08-18 0
93 -141.5198 62.66149 2024-08-11 0
93 -141.5198 62.66149 2024-08-12 0
93 -141.5198 62.66149 2024-08-13 0
93 -141.5198 62.66149 2024-08-14 0
93 -141.5198 62.66149 2024-08-15 0
93 -141.5198 62.66149 2024-08-16 0
93 -141.5198 62.66149 2024-08-17 0
93 -141.5198 62.66149 2024-08-18 0
94 -141.7671 62.69760 2024-08-11 0
94 -141.7671 62.69760 2024-08-12 0
94 -141.7671 62.69760 2024-08-13 1
94 -141.7671 62.69760 2024-08-14 1
94 -141.7671 62.69760 2024-08-15 1
94 -141.7671 62.69760 2024-08-16 0
94 -141.7671 62.69760 2024-08-17 1
94 -141.7671 62.69760 2024-08-18 1
95 -141.8836 62.84525 2024-08-11 0
95 -141.8836 62.84525 2024-08-12 0
95 -141.8836 62.84525 2024-08-13 0
95 -141.8836 62.84525 2024-08-14 0
95 -141.8836 62.84525 2024-08-15 0
95 -141.8836 62.84525 2024-08-16 0
95 -141.8836 62.84525 2024-08-17 0
95 -141.8836 62.84525 2024-08-18 0
96 -141.4056 62.63918 2024-08-11 0
96 -141.4056 62.63918 2024-08-12 7
96 -141.4056 62.63918 2024-08-13 1
96 -141.4056 62.63918 2024-08-14 1
96 -141.4056 62.63918 2024-08-15 1
96 -141.4056 62.63918 2024-08-16 0
96 -141.4056 62.63918 2024-08-17 0
96 -141.4056 62.63918 2024-08-18 1
97 -141.9955 63.08118 2024-08-11 1
97 -141.9955 63.08118 2024-08-12 1
97 -141.9955 63.08118 2024-08-13 1
97 -141.9955 63.08118 2024-08-14 1
97 -141.9955 63.08118 2024-08-15 0
97 -141.9955 63.08118 2024-08-16 1
97 -141.9955 63.08118 2024-08-17 0
97 -141.9955 63.08118 2024-08-18 0
98 -141.2499 62.64099 2024-08-11 0
98 -141.2499 62.64099 2024-08-12 0
98 -141.2499 62.64099 2024-08-13 1
98 -141.2499 62.64099 2024-08-14 0
98 -141.2499 62.64099 2024-08-15 0
98 -141.2499 62.64099 2024-08-16 0
98 -141.2499 62.64099 2024-08-17 1
98 -141.2499 62.64099 2024-08-18 1
99 -141.9111 63.05733 2024-08-11 0
99 -141.9111 63.05733 2024-08-12 0
99 -141.9111 63.05733 2024-08-13 1
99 -141.9111 63.05733 2024-08-14 0
99 -141.9111 63.05733 2024-08-15 1
99 -141.9111 63.05733 2024-08-16 1
99 -141.9111 63.05733 2024-08-17 0
99 -141.9111 63.05733 2024-08-18 0
100 -141.7982 62.72635 2024-08-11 0
100 -141.7982 62.72635 2024-08-12 0
100 -141.7982 62.72635 2024-08-13 0
100 -141.7982 62.72635 2024-08-14 0
100 -141.7982 62.72635 2024-08-15 0
100 -141.7982 62.72635 2024-08-16 0
100 -141.7982 62.72635 2024-08-17 0
100 -141.7982 62.72635 2024-08-18 0

Tidying Our Data

  • In tidy data, column names are variables, so they should be structured as such

  • Common variable naming conventions:

    • camelCase
    • snake_case
  • We can use the janitor package to fix all our column names in a single line of code

#Clean column names
tidy_data <- clean_names(tidy_data)
site_number lon lat date presence

New column headers: spaces removed and snake case used

Data Wrangling: Exploratory Data Analysis (EDA)

AI-generated image in claymation style of a witch looking at graphs and numbers on a wall

What is EDA?

Exploratory Data Analysis (EDA) = getting to know your data before drawing conclusions, often through summarization and/or visualization

Example packages: skimr, corrplot, summarytools, DataExplorer, assertr


Are there errors in my data? Are there outliers? How variable is my data?

Are my data within their expected range of values?

Are my variables correlated? Do my variables follow their expected distributions?

What hypotheses can I generate? Are the assumptions for my analyses met?

Witch Survey

Exploring Our Data & Performing Quality Control

Exploring Our Data (EDA)

Let’s rewind and take a closer look at our starting data

  • First, with str()

    #Glimpse of dataset,including datatypes of columns
    str(witch_data)
    tibble [100 × 11] (S3: tbl_df/tbl/data.frame)
     $ Site Number: num [1:100] 1 2 3 4 5 6 7 8 9 10 ...
     $ Lon        : num [1:100] -141 -141 -141 -142 -141 ...
     $ Lat        : num [1:100] 62.7 62.6 62.5 62.7 62.5 ...
     $ 08/11/2024 : num [1:100] 0 0 0 1 0 0 0 1 0 0 ...
     $ 08/12/2024 : chr [1:100] "0" "0" "0" "0" ...
     $ 08/13/2024 : chr [1:100] "0" "0" "0" "1" ...
     $ 08/14/2024 : num [1:100] 0 0 0 0 1 0 0 1 0 0 ...
     $ 08/15/2024 : num [1:100] 0 0 0 0 0 0 0 1 0 0 ...
     $ 08/16/2024 : num [1:100] 0 0 0 1 1 0 0 0 0 0 ...
     $ 08/17/2024 : num [1:100] 0 0 0 0 0 0 0 0 0 0 ...
     $ 08/18/2024 : chr [1:100] "none" "1" "0" "1" ...

Exploring Our Data (EDA)

  • Then, with summary()
#Summary of dataset, including summary stats
summary(witch_data)
  Site Number          Lon              Lat          08/11/2024  
 Min.   :  1.00   Min.   :-142.8   Min.   :62.43   Min.   :0.00  
 1st Qu.: 25.75   1st Qu.:-142.2   1st Qu.:62.56   1st Qu.:0.00  
 Median : 50.50   Median :-141.9   Median :62.65   Median :0.00  
 Mean   : 50.50   Mean   :-141.8   Mean   :62.66   Mean   :0.18  
 3rd Qu.: 75.25   3rd Qu.:-141.5   3rd Qu.:62.71   3rd Qu.:0.00  
 Max.   :100.00   Max.   :-141.0   Max.   :63.15   Max.   :1.00  
  08/12/2024         08/13/2024          08/14/2024     08/15/2024  
 Length:100         Length:100         Min.   :0.00   Min.   :0.00  
 Class :character   Class :character   1st Qu.:0.00   1st Qu.:0.00  
 Mode  :character   Mode  :character   Median :0.00   Median :0.00  
                                       Mean   :0.29   Mean   :0.37  
                                       3rd Qu.:0.00   3rd Qu.:1.00  
                                       Max.   :6.00   Max.   :7.00  
   08/16/2024     08/17/2024    08/18/2024       
 Min.   :0.00   Min.   :0.00   Length:100        
 1st Qu.:0.00   1st Qu.:0.00   Class :character  
 Median :0.00   Median :0.00   Mode  :character  
 Mean   :0.27   Mean   :0.27                     
 3rd Qu.:1.00   3rd Qu.:0.00                     
 Max.   :1.00   Max.   :6.00                     

Frank and Stein the Wildlife Biologists

Roles: field work, data recording

Graphic of a man labeled "Frank" with the note "Records 'none' rather than '0' on the data sheets," and a woman labeled "Stein" with the note "has illegible handwriting (her 0's can look like 2's or 7's)"

Casper the friendly Biotech

Role: data entry/digitization

Graphic of a boy labeled "Casper" with the note "Enters data exactly as it is written on the datasheet"

Handwritten "0" on an orange background made to look similar to a "6"

Handwritten "1" on an orange background made to look similar to a "2"

Handwritten "1" on an orange background made to look similar to a "7"

EDA for Quality Control

See why our presence data is non-numeric

#Find non-numerics
tidy_data$presence[which(is.na(as.numeric(tidy_data$presence)))]
[1] "none" "none" "none"


Replace all instances of "none" with 0

#Fix non-numerics
tidy_data$presence[which(tidy_data$presence == "none")] <- 0
tidy_data$presence <- as.integer(tidy_data$presence)

EDA for Quality Control

Explore distribution

#Plot histogram of "presence" values
hist(tidy_data$presence)

Correct misread numbers

#Fix typos
tidy_data$presence[which(tidy_data$presence == 6)] <- 0
tidy_data$presence[which((tidy_data$presence == 2) | (tidy_data$presence == 7))] <- 1

More EDA Options

  • Use DataExplorer to generate a comprehensive report
    • Includes summary statistics, distributions, missing data insights, correlation analysis, PCA, qq plots, and more
create_report(tidy_data, output_format = pdf(), output_file = "report.pdf")
  • Endless options!

Preservation

AI-generated image in claymation style of a witch in a cottage putting documents into a vault to preserve them

A data workflow flow chart with "Project Setup", "Data Wrangling", "Preserve Data", "Analyze", "Summarize Results", "Report", and "Preserve Products" connected unidirectionally by arrows, with the "Preserve Data" box highlighted in yellow

Preserving Data and Data Assets

Yes, already!

Preservation should occur several times during the data management lifecycle and include all data, metadata, and data assets (e.g., protocols, presentations, reports, code)

Tip

Contact your program’s data manager for program-specific preservation guidelines.

  • Fisheries and Ecological Services - Jonah Withers

  • Migratory Birds Management - Tammy Patterson

  • National Wildlife Refuge Program - Caylen Cummins

  • Other programs - Hilmar Maier

Reminder: Reproducibility and reuse are impossible without findability

Witch Survey

Preserving Our Data

Preserving Our Data

To Do List :

  1. Write machine-readable metadata, including a data dictionary
  2. Preserve raw data and script file (if reusing) in ServCat
  3. Link new ServCat references to the “Tetlin Witch Survey” ServCat Project

A step further…

Tidy, QC, compile, and preserve all 20 years of data

Preserve Data Assets

Uh oh

  • All past workbook sheets are in the same untidy format

  • And Frank used none instead of 0 since the survey began

Don’t worry, we can reuse our script!

Suggestion

Wrapping the script into a function makes this even more streamlined (optional)

Preserve Data Assets

#Load packages
library(tidyverse)
library(readxl)
library(janitor)

#Import raw data
witch_data <- read_excel("data/xlsx/witch_survey.xlsx", sheet = "2024")

#Tidy data structure
tidy_data <- pivot_longer(witch_data, cols = starts_with("08"), names_to = "Date", values_to = "Presence", names_transform = list(Date = mdy), values_transform = list(Presence = as.character))

#Clean column names
tidy_data <- clean_names(tidy_data)

#Fix non-numerics
tidy_data$presence[which(tidy_data$presence == "none")] <- 0
tidy_data$presence <- as.integer(tidy_data$presence)

#Fix typos
tidy_data$presence[which(tidy_data$presence == 6)] <- 0
tidy_data$presence[which((tidy_data$presence == 2) | (tidy_data$presence == 7))] <- 1

#Export tidy csv
write.csv(tidy_data, file = "data/tidy_witch_data.csv", row.names = FALSE)
wrangle_witch_data <- function(year){
  #Import raw data
  witch_data <- read_excel("data/xlsx/witch_survey.xlsx", sheet = paste0(year))
  
  #Tidy data structure
  tidy_data <- pivot_longer(witch_data, cols = starts_with("08"), names_to = "Date", values_to = "Presence", names_transform = list(Date = mdy), values_transform = list(Presence = as.character))
  
  #Clean column names
  tidy_data <- clean_names(tidy_data)
  
  #Fix non-numerics
  tidy_data$presence[which(tidy_data$presence == "none")] <- 0
  tidy_data$presence <- as.integer(tidy_data$presence)
  
  #Fix typos
  tidy_data$presence[which(tidy_data$presence == 6)] <- 0
  tidy_data$presence[which((tidy_data$presence == 2) | (tidy_data$presence == 7))] <- 1
  
  #Return tidy dataframe
  return(tidy_data)
}
#' Tidy and QC witch data
#'
#' @param year The year (YYYY) representing the worksheet name to pull data from
#'
#' @return A tidied dataframe
#' @export
#'
#' @examples
#' clean_witch_data(year = 2024)
wrangle_witch_data <- function(year){
  #Import raw data
  witch_data <- read_excel("data/xlsx/witch_survey.xlsx", sheet = paste0(year))
  
  #Tidy data structure
  tidy_data <- pivot_longer(witch_data, cols = starts_with("08"), names_to = "Date", values_to = "Presence", names_transform = list(Date = mdy), values_transform = list(Presence = as.character))
  
  #Clean column names
  tidy_data <- clean_names(tidy_data)
  
  #Fix non-numerics
  tidy_data$presence[which(tidy_data$presence == "none")] <- 0
  tidy_data$presence <- as.integer(tidy_data$presence)
  
  #Fix typos
  tidy_data$presence[which(tidy_data$presence == 6)] <- 0
  tidy_data$presence[which((tidy_data$presence == 2) | (tidy_data$presence == 7))] <- 1
  
  #Return tidy dataframe
  return(tidy_data)
}

Preserve Data Assets

Can run our function for each year and compile data as follows:

#Tidy first year of data
compiled_data <- wrangle_witch_data(2005)

#Iterate through each year, tidy data for that year, and join with rest of tidy data
for(val in 2006:2024){
  compiled_data <- full_join(compiled_data, wrangle_witch_data(year = val))
}

#Export
write.csv(compiled_data, file = "data/csv/compiled_witch_data.csv", row.names = FALSE)

Preserve Data Assets

Tidy, compiled data ready to be preserved and shared

Rows: 16,000

Preserve Data Assets

Eliminate input files through ServCat API requests!

library(httr2)

#' Pull complete Tetlin Witch Survey dataset from ServCat
#'
#' @return dataframe of all years witch observation data
#' @export
#'
#' @examples
#' pull_witch_data()
pull_witch_data <- function(){
  #API request
  url <- "https://ecos.fws.gov/ServCatServices/servcat/v4/rest/DownloadFile/1234"
  response <- httr2::req_perform(request(url))
  
  #Extract file name from response header
  filename <- sub('.*filename="([^"]+)".*',"\\1", response$headers$`content-disposition`)
  
  #Save file
  writeBin(response$body, paste0("data/",filename))
  
  #Import dataset
  return(read.csv(paste0("data/",filename)))
}

From now on, get all data with just: my_data <- pull_witch_data()

Break Time

Analysis

An AI generated image of a claymation witch sitting at a desk in the boreal forest writing code.

A diagram of the data workflow from Project setup to Preserve Products. The Analyze step is highlighted.

Analysis

Criteria for Best Practice

  • The steps are clear
  • The workflow is reproducible
  • Limited opportunities for human error

Analysis: Manual Workflow

Steps

  1. Reformat observation data
  2. Get spatial covariates
  3. Load data into software (PRESENCE, Mark, Distance, etc.)
  4. Use interface to select options
  5. Run it and export results

An image of a stack of Microft windows from Program MARK.

Compare Workflows

Manual

  • Restricted to functions in the software


  • “Black Box”
  • Difficult/time-consuming to document and reproduce steps
  • Must extract results into another software to visualize

Scripted

  • Many custom R packages for performing most common ecological data analyses
  • R packages are generally well-documented
  • Your code documents your steps


  • Self-contained workflow

Witch Survey

Analysis

Get Covariates

# Refuge boundary
source("./R/spatial_helpers.R")
tetlin <- get_refuge("Tetlin National Wildlife Refuge")

# NLCD layer
library(FedData)
get_nlcd(tetlin, label = "tetlin", year = 2016, landmass = "AK")

A map show National Land Cover Data and the boundary of Tetlin Refuge.

Calculate Distances

library(terra)

# Calculate distance to forest
forest <- terra::segregate(nlcd, classes = 42)  # Extract the forest layer
forest <- terra::classify(forest, 
                          rcl = matrix(c(1, 0, 1, NA), 
                                       nrow = 2, 
                                       ncol = 2))  # Reclassify 0 as NA
forest <- terra::distance(forest)
forest <- project(forest, "EPSG: 4326")  # Reproject to WGS84
forest <- mask(crop(forest, ext(tetlin)), tetlin)
names(forest) <- "forest"

# Calculate distance to water
water <- terra::segregate(nlcd, classes = 11)  # Extract the water layer
water <- terra::classify(water, rcl = matrix(c(1, 0, 1, NA), 
                                             nrow = 2, 
                                             ncol = 2))  # Reclassify 0 as NA
water <- terra::distance(water)
water <- project(water, "EPSG: 4326")  # Reproject to WGS84
water <- mask(crop(water, ext(tetlin)), tetlin)
names(water) <- "water"

A map of Distance to Forest for Tetlin National Wildlife Refuge.

A map of Distance to Water in Tetlin National Wildlife Refuge.

Extract Covariates to Sites

# Required packages
library(sf)
library(terra)

# Get witch observation data from ServCat
sites <- pull_witch_data() %>% filter(year == 2024)

# Reformat for `unmarked` package
sites <- reformat(sites)

# Extract covariates to sites
sites <- data.frame(sites,
                    forest = terra::extract(forest, sites)$forest,
                    water = terra::extract(water, sites)$water)

Single-Season Occupancy Model

# Required package
library(unmarked)

# Create an unmarked data frame (scaled covariates)
unmarked_df <- unmarkedFrameOccu(y = sites[,5:13], # observations
                                 siteCovs = sites[,4:5]) # covariates
sc <- scale(site_covs)  # scale them
siteCovs(unmarked_df) <- sc  # add back

# Fit single-season occupancy model
mod <- unmarked::occu(formula = ~forest ~ water + 
                                forest, 
                        data = unmarked_df[[1]])

# Look at estimates
mod@estimates
Occupancy:
            Estimate    SE      z P(>|z|)
(Intercept)   0.0923 0.213  0.433  0.6651
water         0.8643 0.337  2.568  0.0102
forest       -0.4465 0.300 -1.487  0.1370

Detection:
            Estimate    SE     z P(>|z|)
(Intercept)  -0.0507 0.115 -0.44  0.6596
forest        0.7406 0.325  2.28  0.0226

Summarize Results

An AI generated image of a claymation witch sitting in front of a computer in the boreal forest. She has a thinking bubble over her head. In the bubble is a statistical plot. A data workflow diagram, starting at Project Setup and ending with Preserve Products. The Summarize Results step is highlighted.

Summarize Results

Criteria for Best Practice

  • Customizable
  • Updateable
  • Standardized

Summarize Results: Manual Workflow

Steps

  1. Import results and data into Excel, ArcGIS Pro, etc.
  2. Create summary tables, plots, and maps.
  3. Reformat style to match document.
  4. Export as images or Excel files.
  5. (Rinse and repeat…)

A funny image downplaying on our fears of AI by showing a mistake in Excel

https://www.reddit.com/r/ProgrammerHumor/comments/fiw1rw/excel/

Summarize Results: Compare Workflows

Manual

  • Introduce human error
  • Limited plotting function
  • Static output

Scripted

  • Self-contained workflow
  • Endless options for visualizations
  • Options for static, dynamic, and interactive outputs

Witch Survey

Results

Witch Survey Results

Occupancy (\(\psi\))

# Calculate predicted occupancy
pred <- rbind(unmarked::plotEffectsData(mod, "state", "forest"), 
              unmarked::plotEffectsData(mod, "state", "water")) |>
  mutate(covariateValue = case_when(
    covariate == "forest" ~ covariateValue * attr(sc, 'scaled:scale')[[1]] + attr(sc, 'scaled:center')[[1]],
    covariate == "water" ~ covariateValue * attr(sc, 'scaled:scale')[[2]] + attr(sc, 'scaled:center')[[2]]
  ))

Witch Survey Results

Detection

# Calculate predicted detection
pred_det <- unmarked::plotEffectsData(mod, "det", "forest") |>
  mutate(covariateValue = covariateValue * attr(sc, 'scaled:scale')[[1]] + attr(sc, 'scaled:center')[[1]])

Witch Survey Results

Occupancy (\(\psi\))


library(ggplot2)

# Plot predicted values (psi)
ggplot(pred, aes(x = covariateValue, y = Predicted),
  group = covariate) +
  geom_line() +
  geom_ribbon(aes(ymin = lower, ymax = upper),
              linetype = 2,
              alpha = 0.1) +
  xlab("Distance (m)") +
  ylab("Psi") +
  theme_fws() +
  facet_grid(~covariate, scales = "free")

 

Witch Survey Results

Detection


# Plot predicted values (detection)
ggplot(pred, aes(x = covariateValue, 
                 y = Predicted)) +
         geom_line() +
         geom_ribbon(aes(ymin = lower, 
                         ymax = upper), 
                     linetype = 2, 
                     alpha = 0.1) +
         xlab("Distance (m)") +
         ylab("Detection (p)") +
         theme_fws()

Witch Survey Results

Maps

#' Create a leaflet map of occupancy within a refuge
#'
#' @param ras a `terra::ras` raster of psi estimates
#' @param s  an `sf::st_point` of the sites surveyed
#' @param r an `sf` multipolygon of the refuge boundary
#' @para p whether to map the predicted value of psi ("Predicted") or SEs ("SE")
#' @param h the height of the leaflet map returned
#' @param w the width of the leaflet map returned
#'
#' @return a leaflet map
#'
#' @import RColorBrewer
#' @import leaflet
#' @import terra
#' 
#' @export
#'
#' @example 
#' \dontrun{
#' create_map(ras = psi, s = sites, r = tetlin, p = "Predicted", h = 650, w = 300)
#' }

create_map <- function(ras, 
                       s, 
                       r,
                       p = "Predicted",
                       h = NULL,
                       w = NULL) {
  if (p == "Predicted") {
    x <- c(round(minmax(ras)[[1,1]],2), 
           round(minmax(ras)[[2,1]],2))
    grp <- "Psi"
    ras <- ras$Predicted
  } else if (p == "SE") {
    x <- c(round(minmax(ras)[[1,2]],2), 
           round(minmax(ras)[[2,2]],2))
    grp <-"SE"
    ras <- ras$SE
  }
  
    
  pal_rev <- colorNumeric(RColorBrewer::brewer.pal(5, "Spectral"), 
                          x, 
                          reverse = TRUE, 
                          na.color = "#00000000")
  pal <- colorNumeric(RColorBrewer::brewer.pal(5, "Spectral"), 
                      x)
  
  leaflet(height = h, width = w) |> 
    addTiles() |>
    addRasterImage(ras, 
                   colors = pal_rev, 
                   maxBytes = 10168580, 
                   opacity = 0.75, 
                   group = grp) |>
    addCircleMarkers(data = s, lat = ~Y, lng = ~X, 
                     radius = 0.5, 
                     color = "black", 
                     group = "sites") |>
    addPolygons(data = r,
                fill = FALSE,
                color = "black",
                group = "Tetlin",
                weight = 0.5) |>
    addLayersControl(overlayGroups = c(grp, 
                                       "sites", 
                                       "Tetlin"),
                     options = layersControlOptions(collapsed = FALSE)) |>
    addLegend(pal = pal,
              values = x,
              title = grp,
              labFormat = labelFormat(transform = function(x) sort(x, decreasing = TRUE))) |>
    addMiniMap(height = 100, 
               width = 100) |>
    addScaleBar()
}



base_map <- function(s, r, h = NULL, w = NULL) {
  leaflet(height = h, width = w) |> 
    addTiles() |>
    addCircleMarkers(data = s, lat = ~Y, lng = ~X, 
                     radius = 0.5, 
                     color = "black", 
                     group = "sites") |>
    addPolygons(data = r,
                fill = FALSE,
                color = "black",
                group = "Tetlin",
                weight = 0.5) |>
    addLayersControl(overlayGroups = c("sites", 
                                       "Tetlin"),
                     options = layersControlOptions(collapsed = FALSE)) |>
    addMiniMap(height = 100, 
               width = 100) |>
    addScaleBar()
}

Witch Occupancy (\(\psi\))

# Generate a raster of predicted occupancy
ras <- c(water, forest)  # Combine our rasters
psi <- unmarked::predict(mod, 
                         type = "state", 
                         newdata = ras)

# Source the `create_map()` function
source("./R/create_map.R")

# Create a map
create_map(ras = psi, 
           s = sites, 
           r = tetlin, 
           h = 650,
           w = 300)

Precision of Estimates (SE)

# Source the `create_map()` function
source("./R/create_map.R")

# Import data
tetlin <- sf::st_read("data/shapefile/tetlin.shp", 
                      quiet = TRUE)
sites <- read.csv("data/csv/sites.csv")
psi <- terra::rast("data/raster/psi/psi.tif")

# Create a map
create_map(ras = psi, 
           s = sites, 
           r = tetlin, 
           p = "SE",
           h = 650,
           w = 300)

Report

An AI generated image of a claymation style witch handing a man a report. They are in the boreal forest. A lynx is in the background A data workflow diagram, starting with Project Setup and ending with Preserve Products. The Report step is highlighted.

Report

Criteria for Best Practice

  • Easy to update
  • Clear link between the data and the report
  • Reproducible

Report: Manual Workflow

Steps

  1. Copy/paste tables and figures into Word
  2. Calculate inline statistics and add into doc
  3. Update formatting to look good
  4. Repeat steps for PowerPoint presentation

An cartoon image of a man taking off his glasses. In the speech bubble, it say Wow! Copy/paste all day? I'm SOO lucky!

Reporting in R: Quarto An image of the Quarto logo.

An image of a three step workflow for rendering a Quarto document. The first bubble has logos for R and other programming languages. The middle bubble says Quarto and the last bubble shows HTML, PDF and MS Word docs.

Reporting in R: Shiny The R Shiny logo.

An screenshot of a R Shiny app example.

Witch Survey

Report

Witch Report

Quarto Code

```{r}
---
title: "Tetlin Witch Report"
author: Jane Biologist
format: html
fig-align: center
editor: source
---


```{{r setup}}
#| echo: false
#| message: false

knitr::opts_chunk$set(warning = FALSE, 
                      echo = FALSE,
                      message = FALSE, 
                      fig.retina = 3, 
                      fig.align = "center")
library(unmarked)
library(terra)
library(tidyverse)
library(RColorBrewer)
library(sf)
library(leaflet)
```

```{{r load_data}}
#| cache: true

# Load site data
dat <- read.csv("data/csv/dat.csv")

source("R/simulate_data.R")
source("R/create_map.R")

# Scaled covariates
sc <- dat |>
    dplyr::select(forest, water) |>
    scale()

# Load site data and scale them
load("./data/rdata/unmarked_df.Rdata")
```

```{{r fit_model}}
#|cache: true

# Fit single season occupancy model
mod <- fit_model(unmarked_df)
```

## Introduction

Invasive witches have become a management concern at Tetlin National Wildlife Refuge. As such, there is a need to estimate witch occurrence within the Refuge.

## Methods

### Data Collection

We visited a sample randomly distributed sites across Tetlin Refuge. At each site, we spent one hour looking and listening for witches. We revisited each site eight times.

### Model

We estimated witch occupancy and detection using a single-season occupancy model. We used the `unmarked` R package. [blah, blah, blah]


## Results

We surveyed a total of `r nrow(dat)` sites. The average distance to water at our sites was `r round(mean(dat$water), 2)` m. The average distance to forest at our sites was `r round(mean(dat$forest), 2)` m.

```{{r}}
#| out-width: "50%"
#| fig-cap: "A map of the sites surveyed for witches, Tetlin National Wildlife Refuge, Alaska."

# Import data
tetlin <- sf::st_read("data/shapefile/tetlin.shp", 
                      quiet = TRUE)
sites <- read.csv("data/csv/sites.csv")

# Create leaflet map
base_map(sites, tetlin)
```

We observed witches on `r sum(dat[6:13])` of 800 site visits, for a naive occupancy of `r round(sum(dat[6:13])/ncell(dat[6:13]), 2)`. 

```{{r plot_psi}}
#| fig-height: 3
#| fig-cap: Occupancy of witches at Tetlin National Wildlife Refuge, Alaska, 2024.

# Calculate predicted values (unscaled)
pred <- rbind(plotEffectsData(mod, "state", "forest"), plotEffectsData(mod, "state", "water")) %>%
  mutate(covariateValue = case_when(
    covariate == "forest" ~ covariateValue * attr(sc, 'scaled:scale')[[1]] + attr(sc, 'scaled:center')[[1]],
    covariate == "water" ~ covariateValue * attr(sc, 'scaled:scale')[[2]] + attr(sc, 'scaled:center')[[2]]
  ))

# Plot predicted values (psi)
ggplot(pred, aes(x = covariateValue, y = Predicted), 
  group = covariate) + 
  geom_line() +
  geom_ribbon(aes(ymin = lower, ymax = upper), 
              linetype = 2, 
              alpha = 0.1) +
  xlab("Distance (m)") +
  ylab("Psi") +
  facet_grid(~covariate, scales = "free")
```

```

Rendered Report

Prettier Witch Report

A screenshot of the cover page of a templated Word doc rendered from Quarto. A screenshot of another page of a templated Word doc rendered from Quarto.

Quarto Templates

A screenshot of the GitHub repository for the akrreportr R package.

Share Products

An image showing the various R packages and programming languages that are compatable with Posit Connect.

Preserve Products

An AI generated image of a claymation style witch. She is angry and writing on a paper at a desk in the boreal forest. There is a moose in the background. An image of a data workflow, starting with Project Setup and ending with Preserve Products. The Preserve Products step is highlighted.

Summary

An image of a data workflow, starting with Project Setup and ending with Preserve Products.

Questions