Reads GPS data and configuration, computes representative assessment and potential Key Biodiversity Area (KBA), and saves the resulting map as a PNG file.
- Parameters:
options: named listconfig-path(character) — path to the configuration file (JSON).data-path(character) — path to the input GPS data file (CSV).output-path(character) — path where the output PNG plot is saved.percentage-distribution(integer) — percentage distribution for the assessment.n-iterations(integer) — number of bootstrap iterations for the assessment.population-size(integer) — population size for KBA site identification.smoothing-method(character) — smoothing method for kernel density estimation.
- Returns: None. Side effect: writes a PNG file to
output-path. - Notes: Disables S2 spherical geometry (
sf_use_s2) for compatibility withtrack2KBA.
Reads GPS data and configuration, computes the representative assessment, and saves the resulting plot as a PNG file.
- Parameters:
options: named listconfig-path(character) — path to the configuration file (JSON).data-path(character) — path to the input GPS data file (CSV).output-path(character) — path where the output PNG plot is saved.percentage-distribution(integer) — percentage distribution for the assessment.n-iterations(integer) — number of bootstrap iterations for the assessment.smoothing-method(character) — smoothing method for kernel density estimation.
- Returns: None. Side effect: writes a PNG file to
output-path.
Reads GPS data and configuration, computes kernel density estimates (KDE) for each tracked individual, and saves the resulting map as a PNG file.
- Parameters:
options: named listconfig-path(character) — path to the configuration file (JSON).data-path(character) — path to the input GPS data file (CSV).output-path(character) — path where the output PNG plot is saved.percentage-distribution(integer) — percentage distribution for the KDE.
- Returns: None. Side effect: writes a PNG file to
output-path.
Generates a summary of trips from GPS data and configuration, and writes it to a CSV file.
- Parameters:
options: named listconfig-path(character) — path to the configuration file (JSON).data-path(character) — path to the input GPS data file (CSV).output-path(character) — path where the output CSV summary is saved.
- Returns: None. Side effect: writes a CSV file to
output-path. - Notes: The output CSV contains columns
tripID,n_locs,departure,return,duration,total_dist.
Extracts individual foraging trips from GPS data and writes the result to a CSV file.
- Parameters:
options: named listconfig-path(character) — path to the configuration file (JSON).data-path(character) — path to the input GPS data file (CSV).output-path(character) — path where the output CSV file is saved.
config_content(list) — configuration content (optional; overwritten by reading fromconfig-path).
- Returns: None. Side effect: writes a CSV file to
output-path. - Notes: The output CSV contains columns
tripID,Latitude,Longitude.
Filters raw fisheries GPS data by date range and geographic bounding box, then writes the filtered data to a CSV file.
- Parameters:
options: named listdata-path(character) — path to the input fisheries GPS data file (CSV).output-path(character) — path where the filtered output CSV file is saved.start(character) — start date for filtering (inclusive, formatYYYY-MM-DD).end(character) — end date for filtering (inclusive, formatYYYY-MM-DD).lat-min(numeric) — minimum latitude for filtering.lat-max(numeric) — maximum latitude for filtering.lon-min(numeric) — minimum longitude for filtering.lon-max(numeric) — maximum longitude for filtering.
- Returns: None. Side effect: writes a CSV file to
output-path.
Filters GPS data between two inclusive dates and writes the result to a CSV file.
- Parameters:
options: named listdata-path(character) — path to the input GPS data file (CSV).output-path(character) — path where the filtered output CSV file is saved.start(character) — start date for filtering (inclusive).end(character) — end date for filtering (inclusive).date-column-name(character) — name of the date column in the input data.
- Returns: None. Side effect: writes a CSV file to
output-path.
Defines and returns a named list of command-line options for use in CLI tools.
- Parameters: None.
- Returns: A named list of command-line options. Names:
data-path,config-path,output-path,percentage-distribution,n-iterations,start,end,lat-min,lat-max,lon-min,lon-max,population-size,smoothing-method,date-column-name.
Projects tracks, estimates smoothing scale, and computes kernel density estimates (KDE) for each tracked individual.
- Parameters:
data(data.frame) — GPS tracking data with aReturnscolumn.config(list) — configuration withcolony(tibble ofLongitude,Latitude).levelUD(numeric) — percentage contour level for KDE polygons.smoothing_method(character) — smoothing method for KDE. One of"log_median","reference_bandwidth","scale_ARS".
- Returns: A list with elements
KDE_surface(estUDm),UDPolygons(sf), andtracks(SpatialPointsDataFrame).
Bootstraps across individuals to assess how representative the sample is.
Wraps track2KBA::repAssess with bootTable=TRUE. Suppresses the inline base R
plot.
- Parameters:
KDE_surface(estUDm) — kernel density estimates fromcompute_individual_kde.tracks(SpatialPointsDataFrame) — projected tracking data.levelUD(numeric) — percentage contour level.n_iterations(integer) — number of bootstrap iterations.
- Returns: A list with elements
assessment_summary(data.frame, single row with columnsout,asym,Rep70,Rep95) andassessment_detail(data.frame, full iteration table).
Identifies potential Key Biodiversity Areas (KBAs) based on the representative
assessment. Wraps track2KBA::findSite.
- Parameters:
KDE_surface(estUDm) — kernel density estimates.represent(numeric) — representativity value (fromassessment_summary$out).popSize(numeric) — population size for the KBA criterion.levelUD(numeric) — percentage contour level.
- Returns: An sf object with polygon data (columns
N_IND,N_animals,potentialSite).
Composes compute_individual_kde + compute_representative_assessment. Calls
repAssess exactly once. Returns only the bootstrap output for caching.
- Parameters:
data(data.frame) — GPS tracking data with aReturnscolumn.config(list) — configuration withcolony(tibble).levelUD(numeric) — percentage contour level.smoothing_method(character) — smoothing method for KDE.n_iterations(integer) — number of bootstrap iterations.
- Returns: A list with elements
assessment_summaryandassessment_detail(same ascompute_representative_assessment).
Reads a JSON configuration file and returns its content as a list with a parsed colony tibble.
- Parameters:
config_path(character) — path to the JSON configuration file.
- Returns: A list with keys:
inner_buff(numeric),return_buff(numeric),duration(numeric),colony(tibble with columnsLongitude,Latitude). - Errors: File not found or invalid JSON (delegated to
rjson::fromJSON).
Converts raw GPS data into a spatial data frame of individual foraging trips.
- Parameters:
data(data.frame) — raw GPS data with columnsname,date,time,longitude,latitude.config_content(list) — configuration list with elementscolony(tibble),inner_buff(numeric, km),return_buff(numeric, km),duration(numeric, hours).
- Returns: A
SpatialPointsDataFramewith trip assignments. Each row is a GPS fix annotated with trip ID. - Notes: Filters out non-returning trips (
rmNonTrip = TRUE). Date-time format isymd_HMS.
Generates a summary table of trip characteristics from a tripSplit output.
- Parameters:
trips(data.frame) — trip data fromget_trips.config_content(list) — configuration list with elementcolony(tibble).
- Returns: A data.frame with one row per trip and columns including trip ID, completeness status, and derived metrics.
Computes candidate smoothing parameter values for kernel density estimation.
- Parameters:
tracks(SpatialPointsDataFrame) — projected tracking data.trips_summary(data.frame) — trip summary fromtripSummary.
- Returns: A data.frame with 5 columns of scale parameters. Column
magcontains the log-median scale estimate.
Filters fisheries data rows within an inclusive date range.
- Parameters:
fisheries_data(data.frame) — fisheries GPS data with columnFechaRecepcionUnitrac.start(character) — start date (YYYY-MM-DD, inclusive).end(character) — end date (YYYY-MM-DD, inclusive).
- Returns: A filtered data.frame with rows whose
FechaRecepcionUnitracfalls within[start, end].
Filters fisheries data rows within a geographic bounding box.
- Parameters:
fisheries_data(data.frame) — fisheries GPS data with columnsLatitude,Longitude.lat_min(numeric) — minimum latitude.lat_max(numeric) — maximum latitude.lon_min(numeric) — minimum longitude.lon_max(numeric) — maximum longitude.
- Returns: A filtered data.frame with rows whose coordinates fall within the bounding box.
filter_fisheries_by_date_and_lat_lon(fisheries_data, start, end, lat_min, lat_max, lon_min, lon_max)
Composes date-range and bounding-box filters on fisheries data.
- Parameters:
fisheries_data(data.frame) — fisheries GPS data.start(character) — start date (YYYY-MM-DD, inclusive).end(character) — end date (YYYY-MM-DD, inclusive).lat_min(numeric) — minimum latitude.lat_max(numeric) — maximum latitude.lon_min(numeric) — minimum longitude.lon_max(numeric) — maximum longitude.
- Returns: A filtered data.frame satisfying all criteria.
Orchestrates the track2KBA workflow: projection, scale estimation, kernel density estimation, representativity assessment, and KBA identification.
- Parameters:
trips_data(data.frame) — GPS tracking data with aReturnscolumn.config_content(list) — configuration withcolony(tibble ofLongitude,Latitude).percentage_distribution(numeric) — percentage distribution for KDE.smoothing_method(character, default"log_median") — smoothing method for KDE. One of"log_median","reference_bandwidth","scale_ARS".
- Side effects: Stores
complete_trips,colony,tracks,percentage_distribution,smoothing_method, andKDEas public fields.
Projects complete trips to an azimuthal equidistant projection.
- Parameters: None (uses
self$complete_trips). - Returns: A
SpatialPointsDataFrameof projected tracking data.
Computes a dictionary of candidate smoothing parameters for KDE.
- Parameters: None (uses
self$complete_trips,self$colony,self$tracks). - Returns: A named list with keys
log_median,reference_bandwidth,scale_ARS.
Computes kernel density estimates (KDE) for each individual.
- Parameters:
percentage_distribution(numeric) — percentage contour level for the KDE polygons.
- Returns: A list with elements
KDE.Surface(raster) andUDPolygons(SpatialPolygonsDataFrame with area column). - Notes: The number of output polygons equals the number of tracked individuals. Area output depends on the projection and contour level.
Bootstraps across individuals to assess how representative the sample is.
- Parameters:
percentage_distribution(numeric) — percentage distribution for the assessment.n_iterations(integer) — number of bootstrap iterations.
- Returns: A data.frame with column
outcontaining the representativity percentage.
Identifies potential Key Biodiversity Areas (KBAs) based on the representative assessment.
- Parameters:
repr(data.frame) — result fromcompute_representative_assessment, must contain anoutcolumn.percentage_distribution(numeric) — percentage distribution for site identification.population_size(integer) — population size for the KBA criterion.
- Returns: A spatial object (polygons) of identified potential KBA sites.