View source: R/check_abundance.r
| check_abundance | R Documentation |
This function reads matching MEDITS TA (haul metadata) and
TB (catch numbers) tables for a single survey year, computes the swept
area for each haul, derives haul-level abundance indices expressed as
individuals per km^2, and produces one or more box-plots that summarise the
distribution of those indices by species. The plots are written to the folder
‘<wd>/Graphs/Abundance/’ and a logfile is produced under
‘<wd>/Logfiles/’ with a summary of any quality-control issues
encountered.
check_abundance(ResultDataTA, ResultDataTB, year, wd,
suffix = NULL, distance_unit = "km", min_hauls = 5L)
ResultDataTA |
Data frame containing at least the columns |
ResultDataTB |
Data frame containing at least |
year |
Single numeric value identifying the survey year to analyse. |
wd |
Writable directory where the function will place ‘Logfiles/’ and ‘Graphs/Abundance/’. |
suffix |
Optional text appended to the logfile name. When missing a timestamp is used. |
distance_unit |
Either |
min_hauls |
Minimum number of valid hauls a species must appear in to be
plotted. Defaults to |
A swept area is first computed for every haul from TA. The function
then merges TA and TB. Hauls that lack swept area information
or hauls whose total number of individuals is missing (or equal to zero when
not allowed by the faunistic category) are discarded and reported in the
logfile. Species occurring in fewer than min_hauls valid hauls are also
removed. The remaining species are sorted alphabetically and divided into
blocks of 36; one image file is produced for each block so that labels remain
readable even in years with many species.
The function returns TRUE when no data-quality issues were found and
FALSE otherwise.
Logical scalar (TRUE if no errors, FALSE otherwise).
W. Zupa.
wd <- tempdir()
check_abundance(ResultDataTA = RoME::TA,
ResultDataTB = RoME::TB,
year = 2007,
wd = wd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.