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
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
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
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
Use consistent pattern
Avoid overlapping categories
Don’t let folders get too deep
Document your system
Stick to the plan!
Alaska Regional Data Repository 1
Alaska National Wildlife Refuges 2
# 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!")
}
Github
Gitlab
Basic documentation is as easy as a “#
” (shortcut: CTRL-SHIFT-C
)
Human Readability Reusability
Stay organized with sections (shortcut: CTRL-SHIFT-R
)
Installing packages
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)
The Tetlin Witch Project
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
Do NOT like water
DO favor forest
Completed:
Data collection ✓
Data entry ✓
Next:
Coming soon to your Wild Weekly…
the process of transforming raw data into a usable form
Importing Data ➝ Obtain
Tidying Data ➝ Restructure
Exploratory Data Analysis & Quality Control ➝ Clean, Correct, and Understand
Messy
Prone to human error
Difficult to correct or reverse changes
Inefficient
Not reusable
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
✓ 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!
Can read data from a…
Example:
Examples:
Extra step: merge multiple tables, if necessary
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
Use read_excel()
to import data from a specific sheet in a workbook
Note
Variables are the basis of reusability!
Standardization
Interpretability
Machine readability
Ease of use and reuse
Conducive to metadata
Witch Survey
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
Let’s use tidyverse
to tidy our data in one line by “pivoting”
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 |
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
site_number | lon | lat | date | presence |
---|
New column headers: spaces removed and snake case used
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
Let’s rewind and take a closer look at our starting data
First, with str()
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" ...
summary()
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
Roles: field work, data recording
Role: data entry/digitization
See why our presence data is non-numeric
[1] "none" "none" "none"
Replace all instances of "none"
with 0
Explore distribution
Correct misread numbers
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
To Do List :
A step further…
Tidy, QC, compile, and preserve all 20 years of data
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)
#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)
}
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)
Tidy, compiled data ready to be preserved and shared
Rows: 16,000
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()
Criteria for Best Practice
Witch Survey
Analysis
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"
# 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)
# 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
Criteria for Best Practice
Witch Survey
Results
# 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]]
))
#' 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()
}
# 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)
Criteria for Best Practice
Witch Survey
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