get_all_survey_samples | R Documentation |
These functions get all survey set or sample data for a set of species by major area, activity, or specific surveys. The main functions in this package focus on retrieving the more commonly used typs of data and are often limited to sets and samples that conform to current design-based standards and survey grids. These functions will retrieve everything and therefore require careful consideration of what data types are reasonable to include depending on the purpose. For this reason these function return a lot of columns, although the exact number depends on which types of surveys are being returned.
get_all_survey_samples(
species,
ssid = NULL,
major = NULL,
usability = NULL,
unsorted_only = FALSE,
random_only = FALSE,
grouping_only = FALSE,
include_event_info = FALSE,
include_activity_matches = FALSE,
remove_bad_data = TRUE,
remove_duplicates = TRUE,
return_dna_info = FALSE,
return_specimen_type = FALSE,
drop_na_columns = TRUE,
quiet_option = "message"
)
get_all_survey_sets(
species,
ssid = NULL,
major = NULL,
years = NULL,
join_sample_ids = FALSE,
remove_false_zeros = TRUE,
remove_bad_data = TRUE,
remove_duplicates = TRUE,
include_activity_matches = FALSE,
usability = NULL,
grouping_only = FALSE,
drop_na_columns = TRUE,
quiet_option = "message"
)
species |
One or more species common names (e.g. "pacific ocean
perch") or one or more species codes (e.g. |
ssid |
A numeric vector of survey series IDs. Run |
major |
Character string (or vector) of major stat area code(s) to include (characters). Use get_major_areas() to lookup area codes with descriptions. Default is NULL. |
usability |
A vector of usability codes to include. Defaults to NULL,
but typical set for a design-based trawl survey index is |
unsorted_only |
Defaults to FALSE, which will return all specimens
collected on research trips. TRUE returns only unsorted ( |
random_only |
Defaults to FALSE, which will return all specimens
collected on research trips. TRUE returns only randomly sampled
specimens ( |
grouping_only |
Defaults to FALSE, which will return all specimens or sets
collected on research trips. TRUE returns only sets or specimens from fishing
events with grouping codes that match that expected for a survey. Can also be
achieved by filtering for specimens where |
include_event_info |
Logical for whether to append all relevant fishing event info (location, timing, effort, catch, etc.). Defaults to TRUE. |
include_activity_matches |
Get all surveys with activity codes that match chosen ssids. |
remove_bad_data |
Remove known bad data, such as unrealistic length or weight values and duplications due to trips that include multiple surveys. Default is TRUE. |
remove_duplicates |
Logical for whether to remove duplicated event records due to overlapping survey stratifications when original_ind = 'N'. Default is FALSE. This option only remains possible when ssids are supplied and activity matches aren't included. Otherwise turns on automatically. |
return_dna_info |
Should DNA container ids and sample type be returned? This can create duplication of specimen ids for some species. Defaults to FALSE. |
return_specimen_type |
Should non-otolith structure types be returned? This can create duplication of specimen ids for some species. Defaults to FALSE. |
drop_na_columns |
Logical for removing all columns that only contain NAs. Defaults to TRUE. |
quiet_option |
Default option, |
years |
Default is NULL, which returns all years. |
join_sample_ids |
This option was problematic, so now reverts to FALSE. |
remove_false_zeros |
Default of |
## Not run:
## Import survey catch density and location data by tow or set for plotting
## Specify single or multiple species by common name or species code and
## single or multiple survey series id(s).
## Notes:
## `area_km` is the stratum area used in design-based index calculation.
## `area_swept` is in m^2 and is used to calculate density for trawl surveys
## It is based on `area_swept1` (`doorspread_m` x `tow_length_m`) except
## when `tow_length_m` is missing, and then we use `area_swept2`
## (`doorspread` x `duration_min` x `speed_mpm`).
## `duration_min` is derived in the SQL procedure "proc_catmat_2011" and
## differs slightly from the difference between `time_deployed` and
## `time_retrieved`.
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.