R/match.R
cc_match_ichthyo_by_name.RdRelates net-tow ichthyoplankton (fish egg / larva counts, standardized to
std_tally) to CTD-bottle environmental measurements, filtering the
biological side by scientific name. Supersedes the retired /ichthyodata
Plumber endpoint.
cc_match_ichthyo_by_name(
scientific_name,
env_var = "temperature",
exact_match = TRUE,
life_stage = NULL,
date_min = NULL,
date_max = NULL,
depth_m_min = NULL,
depth_m_max = NULL,
max_dist_km = NULL,
max_time_hr = NULL,
relax_matching = FALSE,
join_method = c("nearest_time", "nearest_dist", "average"),
con = NULL,
version = "latest",
collect = TRUE,
return_sql = FALSE
)Character vector of scientific names to match against
species.scientific_name.
Environmental measurement_type from the bottle_measurement
table (default: "temperature"). See cc_list_measurement_types().
If TRUE (default) match names exactly; if FALSE match
case-insensitively as substrings (ILIKE '%name%').
Optional character vector restricting ichthyo.life_stage
(e.g. "larva", "egg").
Optional date bounds (Date or "YYYY-MM-DD"
string) on the tow start time.
Optional depth bounds (meters) on the bottle environmental observations.
Match tolerances. Default to 2 km / 6 hr, or
5 km / 72 hr when relax_matching = TRUE; an explicit value always wins.
Convenience flag mirroring the old API's
relax_matching: widens the default tolerances to 5 km / 72 hr.
Passed to
cc_match_bio_env().
See cc_match_bio_env().
if (FALSE) { # \dontrun{
# Pacific sardine larvae vs. temperature, Q1 2018, relaxed matching
# (note: CTD-bottle env data ends 2021-05, so Q1 2018 is used as the
# recurring worked example across calcofi4r, int-app and the docs book)
d <- cc_match_ichthyo_by_name(
"Sardinops sagax",
env_var = "temperature",
life_stage = "larva",
date_min = "2018-01-01",
date_max = "2018-03-31",
relax_matching = TRUE)
} # }