Data and code from: Reestablishment of native top-predator suppresses invasive competitor in coastal Norway
Data files
Sep 22, 2026 version files 445.44 MB
-
Agder_elev_data.zip
66.12 MB
-
American_mink_silhouette.png
1.07 MB
-
Camera_information.csv
3.58 KB
-
cascades20240801.zip
34.77 MB
-
datapackage.json
27.91 KB
-
Days_cam_failure.csv
171.57 KB
-
era5_wind_daily_per_camera.csv
3.24 MB
-
Eurasian_otter_silhouette.png
1.23 MB
-
Norway_sf.rds
1.74 MB
-
Norway_shapefile.rds
2.07 MB
-
R_script_for_behavioral_analysis.R
14.26 KB
-
R_script_for_maps.R
15.94 KB
-
R_script_for_occupancy_and_det_freq.R
42.11 KB
-
R_script_for_rhythmic_activity.R
20.56 KB
-
README.md
20.55 KB
-
Vestland_elev_data.zip
334.83 MB
-
Weather_20230301_20240229.csv
46.15 KB
Abstract
This dataset contains camera-trap, environmental, spatial, and figure-support files used to reproduce analyses of invasive American mink and Eurasian otter activity in two coastal regions of Norway. The data package includes a camtrap-dp export from Agouti containing observation, deployment, event, and media metadata; camera-station covariates and coordinates; camera-failure records used to define sampling effort; regional daily weather data; camera-specific daily ERA5 wind summaries; Norway spatial boundary files; elevation raster folders for the two study regions; and silhouette image files used in figure generation.
The core biological data consist of camera-trap detections of American mink and Eurasian otter from March 2023 to February 2024. The associated scripts use these records to generate independent detections, daily camera-level detection histories, regional daily naïve occupancy or detection-incidence summaries, camera-day detection-frequency datasets, behavioural summaries, and rhythmic-activity classifications. Environmental files provide daily temperature, precipitation, and wind covariates that can be joined to camera-day records by region, camera, and date. Spatial and elevation files support reproduction of the publication maps.
The dataset is intended for reuse in reproducing the manuscript analyses and figures, auditing the data-processing workflow, comparing alternative modelling approaches, or conducting related analyses of camera-trap detection frequency, activity timing, and behaviour. The data may also be useful for methodological work on camera-trap effort correction, species interaction analyses, and the integration of camera-trap observations with weather and spatial covariates.
The dataset contains wildlife monitoring data and camera-station metadata. It does not contain human participant data. Users should treat camera locations and deployment information responsibly, particularly where precise coordinates could affect wildlife, field sites, or landowner privacy. Reuse should cite the associated article and dataset, preserve the structure of the camtrap-dp export, and follow any license terms specified by the data repository.
Dataset overview
This data package contains the camera-trap, camera-station, weather, wind, spatial, elevation, and figure-support files used to reproduce the analyses and figures for the otter-mink manuscript. The study compares American mink (Neogale vison) and Eurasian otter (Lutra lutra) detections and behaviour in two coastal Norwegian study regions:
- Agder: otter expansion area.
- Vestland: established otter area.
The analysis scripts assume that all files and folders listed below are placed in the same main working directory:
project_dir <- "enter_your_directory_here"
The camera-trap data package should be located inside:
cascades20240801/
Several CSV files are encoded as Excel-friendly UTF-8 comma-separated files. In R, read these with fileEncoding = "UTF-8-BOM" when using. read.csv().
All compressed folders or bundled directories should be unpackaged/unzipped before running the R scripts. In particular, cascades20240801/, Vestland_elev_data/, and Agder_elev_data/ should exist as normal folders inside project_dir before importation. The map script can unzip elevation tiles inside the elevation folders if .zip raster tiles are present, but the parent folders themselves must already be unpacked and accessible.
File and folder inventory
| File or folder | Type | Rows/contents | s | Description |
|---|---|---|---|---|
cascades20240801/ |
folder | multiple camtrap-dp files | Agouti/camtrap-dp export containing camera-trap metadata, deployments, media, and observations. Used as the primary source of detection and behaviour records. | |
Camera_information.csv |
CSV | 66 rows x 6 columns | Camera-station covariates and coordinates. One row represents one camera station. | |
Days_cam_failure.csv |
CSV | 4017 rows x 4 columns | Camera failure / no-effort log. One row represents one station-date with camera failure information. | |
Weather_20230301_20240229.csv |
CSV | 732 rows x 8 columns | Daily regional weather data from weather stations. One row represents one region-station-date. | |
era5_wind_daily_per_camera.csv |
CSV | 24156 rows x 12 columns | Processed ERA5 wind covariates. One row represents one camera-date. | |
Norway_sf.rds |
RDS | spatial object | Norway outline used for the publication overview map. Load with readRDS(). |
|
Norway_shapefile.rds |
RDS | spatial object | Norway county/administrative polygons used for the overview map and remnant-population highlighting. The map script expects a NAME_1 field. Load with readRDS(). |
|
Vestland_elev_data/ |
folder | raster/elevation tiles | Elevation raster tiles for the Vestland established study area. Used to generate the Vestland elevation map. | |
Agder_elev_data/ |
folder | raster/elevation tiles | Elevation raster tiles for the Agder expansion study area. Used to generate the Agder elevation map. | |
Eurasian_otter_silhouette.png |
PNG | 1024 x 1024 px | Optional otter silhouette used in figure generation. | |
American_mink_silhouette.png |
PNG | 1024 x 1024 px | Optional mink silhouette used in figure generation. | |
R_script_for_occupancy_and_det_freq.R |
R script | analysis code | Reproduces daily naive occupancy / detection-incidence summaries, otter and mink camera-day detection-frequency models, and the occupancy/detection-frequency figure. | |
R_script_for_behavioral_analysis.R |
R script | analysis code | Reproduces mink behaviour summaries, regional behaviour comparisons, time-since-otter behaviour models, and the behavioural figure. | |
R_script_for_rhythmic_activity.R |
R script | analysis code | Reproduces diel/rhythmic activity classification, activity-period summaries, rhythmic-activity models, and the rhythmic-activity figure. | |
Publication_maps.R |
R script | figure code | Reproduces the Norway overview map and the Agder/Vestland study-area elevation maps. |
Folder descriptions
cascades20240801/
This folder is the Agouti/camtrap-dp export used by the scripts. It should contain datapackage.json plus the associated camtrap-dp CSV files. The scripts use camtraptor::read_camtrap_dp() to import the data package and use the package to construct independent detection records.
Expected important files include:
| File | Row meaning | Used for |
|---|---|---|
datapackage.json |
Metadata file describing the camtrap-dp package and associated tables. | Imported by camtraptor::read_camtrap_dp(). |
observations.csv |
One row per observation/event in the Agouti export. | Behaviour analyses and observation-level filtering. |
deployments.csv |
One row per camera deployment/location record. | Camera coordinates, deployment tags, and region assignment. |
| Additional camtrap-dp files | Media, events, and other package tables depending on the Agouti export. | Used indirectly by camtraptor when building record tables. |
Vestland_elev_data/
Elevation data folder for the Vestland established area. The publication map script searches this folder for .zip or .tif elevation tiles. If zipped tiles are present, they are unzipped into a generated unzipped/ subfolder. The rasters are mosaicked, cropped to the Vestland study-area bounding box, and plotted as the elevation background for the Vestland camera map.
Each raster cell represents elevation at a spatial location. Values at or below sea level are masked for the map background.
Agder_elev_data/
Elevation data folder for the Agder expansion area. The publication map script handles this folder in the same way as Vestland_elev_data/: it searches for .zip or .tif elevation tiles, mosaics them if needed, crops to the Agder study-area bounding box, and plots the result as the elevation background for the Agder camera map.
Each raster cell represents elevation at a spatial location. Values at or below sea level are masked for the map background.
CSV data dictionaries
Camera_information.csv
Rows: 66
Row meaning: one camera station.
| Column | Type | Description | Example |
|---|---|---|---|
Station |
character | Full camera-station name. Scripts extract the short camera ID from this field. | A1 Skarvøya |
Lat |
numeric | Camera latitude in decimal degrees. | 58.067474 |
Lon |
numeric | Camera longitude in decimal degrees. | 6.915147 |
Cov_type |
character | Dominant cover type around the camera station. | Vegetation |
Cov_amount |
character | Amount/category of cover around the camera station. | Partial |
Substrate |
character | Substrate category at the camera station. | Veg |
Days_cam_failure.csv
Rows: 4017
Row meaning: one camera station on one date for which a camera-failure/no-effort status is recorded.
| Column | Type | Description | Example |
|---|---|---|---|
Station |
character | Full camera-station name. Scripts extract the short camera ID from this field. | V1 Sydnessund 1 |
Date |
date | Date of the camera-failure/no-effort record. | 2017-11-01 |
Cam_failure |
character | Whether the camera was considered failed / non-operational on that date. | Yes |
Reason |
character | Reason for failure or no-effort status. | Batt_failure |
In the occupancy and detection-frequency scripts, dates marked with Cam_failure == "Yes" are treated as no camera effort, not as true non-detections.
Weather_20230301_20240229.csv
Rows: 732
Row meaning: one weather station/region/date.
| Column | Type | Description | Example |
|---|---|---|---|
Region |
character | Study region associated with the weather station. | Agder |
Station_name |
character | Weather station name. | Lista Fyr |
Stasjon_code |
character | Weather station code. | SN42160 |
Date |
date | Weather date. In the scripts, this is parsed with lubridate::dmy(). |
01.03.2023 |
Min_temp |
numeric | Daily minimum temperature. | -2.0 |
Mean_temp |
numeric | Daily mean temperature. | 3.3 |
Precipitation |
numeric | Daily precipitation. | 0.0 |
Mean_wind |
numeric | Daily mean wind value from the weather station file. | 1.8 |
The main detection-frequency models use Min_temp, Mean_temp, and Precipitation; camera-specific wind covariates are taken from the ERA5 file below.
era5_wind_daily_per_camera.csv
Rows: 24156
Row meaning: one camera station on one date.
| Column | Type | Description | Example |
|---|---|---|---|
Region |
character | Study region. | Agder |
Cam_ID |
character | Short camera ID. | A1 |
Lon |
numeric | Camera longitude in decimal degrees. | 6.915147 |
Lat |
numeric | Camera latitude in decimal degrees. | 58.067474 |
date_local |
date | Local date for the daily wind summary. | 2023-03-01 |
n_obs |
integer | Number of ERA5 observations used in the daily summary. | 4 |
u10_mean |
numeric | Daily mean 10-metre east-west wind component. | -1.27513355016708 |
v10_mean |
numeric | Daily mean 10-metre north-south wind component. | -1.49591548740864 |
wind_speed_ms_mean |
numeric | Daily mean wind speed in metres per second. | 2.55538119218725 |
wind_speed_ms_vec |
numeric | Vector-mean wind speed in metres per second. | 1.9656369746804 |
wind_dir_from_deg |
numeric | Wind direction, in degrees, indicating the direction the wind is from. | 40.4446105867852 |
wind_dir_compass8 |
character | Eight-point compass category for wind direction. | NE |
The detection-frequency scripts convert date_local to Date and join this file to camera-day detection records by Cam_ID and Date.
Spatial files
Norway_sf.rds
R serialized spatial object used as the Norway outline in the publication map. Load in R with:
norway_shape_outline <- readRDS("Norway_sf.rds")
The publication map script simplifies this object with sf::st_simplify() and plots it with geom_sf().
Norway_shapefile.rds
R serialized spatial object containing Norway administrative/county polygons. Load in R with:
norway_counties <- readRDS("Norway_shapefile.rds")
The publication map script expects a county-name field called NAME_1 and highlights the following counties as remnant otter population areas:
c("Nordland", "Troms", "Finnmark", "Hedmark")
Each row of this spatial object represents an administrative polygon/feature.
Figure-support image files
Eurasian_otter_silhouette.png
PNG image file used as an optional otter silhouette in figure generation. Dimensions: 1024 x 1024 pixels.
American_mink_silhouette.png
PNG image file used as an optional mink silhouette in figure generation. Dimensions: 1024 x 1024 pixels.
R code files
The R scripts are designed to be run from the same directory project_dir used throughout this README. Before running them, place all CSV, RDS, PNG, elevation, and camtrap-dp folders inproject_dir, and make sure all folders have been unpackaged/unzipped.
R_script_for_occupancy_and_det_freq.R
This script reproduces the camera-trap occupancy/detection-incidence and detection-frequency analyses. It imports the camtrap-dp package fromcascades20240801/, creates independent records using a 60-minute threshold, builds camera-day detection histories for mink and otter, incorporates camera-failure days as no-effort days, and fits the regional daily naive occupancy and camera-day detection-frequency models. It also joins camera covariates, regional weather, and ERA5 wind covariates to the camera-day data, calculates time since last otter detection for mink camera-days, and generates the occupancy/detection-frequency figure.
Main input files and folders used by this script:
cascades20240801/Days_cam_failure.csvCamera_information.csvWeather_20230301_20240229.csvera5_wind_daily_per_camera.csvAmerican_mink_silhouette.pngandEurasian_otter_silhouette.pngif silhouettes are included in the figure
Main R package dependencies:
camtraptor
camtrapR
dplyr
tidyr
stringr
lubridate
data.table
ggplot2
scales
grid
glmmTMB
car
emmeans
splines
openxlsx
cowplot
R_script_for_behavioral_analysis.R
This script reproduces the mink behaviour analyses. It imports observation-level data from the Agouti/camtrap-dp export, filters to animal event observations for mink and otter during the study period, summarises mink behaviour by region, fits a binomial model comparing investigating behaviour between regions, and fits the Vestland-only time-since-otter behaviour model. The script also generates the two-panel behavioural figure showing regional mink behaviour composition and the model-predicted probability of investigating behaviour as a function of time since otter detection.
Main input files and folders used by this script:
cascades20240801/, especiallydatapackage.json,observations.csv, anddeployments.csv
Main R package dependencies:
camtraptor
readr
dplyr
tidyr
stringr
lubridate
glmmTMB
car
emmeans
splines
ggplot2
scales
cowplot
R_script_for_rhythmic_activity.R
This script reproduces the rhythmic-activity analyses. It imports independent camera-trap records, joins camera coordinates from Camera_information.csv, calculates local dawn, sunrise, sunset, and dusk times using camera coordinates and dates, assigns detections to Dawn, Day, Dusk, or Night, summarises mink and otter activity periods by region and month, and fits binomial GLMMs testing monthly and regional differences in activity periods. It also generates the rhythmic-activity figure showing monthly activity-period proportions for mink and otter.
Main input files and folders used by this script:
cascades20240801/Camera_information.csv
Main R package dependencies:
camtraptor
camtrapR
dplyr
tidyr
stringr
lubridate
purrr
suncalc
glmmTMB
lme4
emmeans
car
ggplot2
ggpattern
ggh4x
cowplot
scales
Publication_maps.R
This script reproduces the publication map figure. It loads the Norway outline and county spatial files, identifies remnant-population counties, loads and mosaics the elevation raster tiles for Agder and Vestland, crops the elevation rasters to the study-area extents, imports camera locations from deployments.csvand combines the Norway overview map with the two study-area elevation maps. The elevation data folders must be present inside project_dir. If the elevation tiles are zipped within those folders, the script unzips them into an unzipped/ subfolder before mosaicking.
Main input files and folders used by this script:
cascades20240801/deployments.csvNorway_sf.rdsNorway_shapefile.rdsVestland_elev_data/Agder_elev_data/
Main R package dependencies:
terra
sf
fs
dplyr
ggplot2
ggspatial
patchwork
ggpubr
grid
Recommended R read-in code
Use BOM-safe CSV read-in for the Excel-friendly CSV files:
caminfo <- read.csv(
"Camera_information.csv",
fileEncoding = "UTF-8-BOM",
colClasses = "character",
check.names = FALSE
)
cam_fail <- read.csv(
"Days_cam_failure.csv",
fileEncoding = "UTF-8-BOM",
check.names = FALSE
)
weather2 <- read.csv(
"Weather_20230301_20240229.csv",
fileEncoding = "UTF-8-BOM",
check.names = FALSE
)
wind_daily_cam <- read.csv(
"era5_wind_daily_per_camera.csv",
fileEncoding = "UTF-8-BOM",
check.names = FALSE
)
If column names such as Station are not found after reading, the most likely cause is that the byte-order mark was not handled. Re-read the file using. fileEncoding = "UTF-8-BOM".
Reproducibility notes
- The main scripts build independent detection records from the camtrap-dp package using a 60-minute independence threshold.
- Camera-failure days are excluded from effort and are not treated as true non-detections.
- Weather and wind covariates are joined to camera-day data by region/date or camera/date.
- Elevation data are used only for map generation and are not used as model covariates.
- The study-area maps expect the elevation folders and RDS spatial files to remain in
project_dir. - The
cascades20240801/folder should remain intact becausedatapackage.jsonpoints to the associated camtrap-dp tables. - All folders should be unpackaged/unzipped before importation. The R scripts expect
cascades20240801/,Vestland_elev_data/, andAgder_elev_data/to be readable as normal folders withinproject_dir.
Quick file checks in R
nrow(read.csv("Camera_information.csv", fileEncoding = "UTF-8-BOM"))
nrow(read.csv("Days_cam_failure.csv", fileEncoding = "UTF-8-BOM"))
nrow(read.csv("Weather_20230301_20240229.csv", fileEncoding = "UTF-8-BOM"))
nrow(read.csv("era5_wind_daily_per_camera.csv", fileEncoding = "UTF-8-BOM"))
norway_outline <- readRDS("Norway_sf.rds")
norway_counties <- readRDS("Norway_shapefile.rds")
nrow(norway_outline)
nrow(norway_counties)
names(norway_counties)
