redist_unidentified_prey_sp: Redistribute unidentified prey species

View source: R/redistribution.R

redist_unidentified_prey_spR Documentation

Redistribute unidentified prey species

Description

Redistribute partly identified preys to the distribution of the identified prey species from the same predator and predator size within the given area and time strata.

Usage

redist_unidentified_prey_sp(
  s,
  dist_time = stratum_time,
  dist_area = stratum_area,
  dist_pred_size = pred_size,
  from_to_species,
  do_only,
  selected_pred,
  remains_to_other = TRUE,
  by_prey_size = TRUE,
  keep_size = TRUE,
  verbose = FALSE
)

Arguments

s

Stomach contents data of class STOMobs with variables stratum_time, stratum_sub_area and stratum_area.

dist_time

Stratum used for time in constructing proportion of species within a prey group of not fully identified prey items. The variable should be made from variable names in s, or constants.

dist_area

Stratum used for area in constructing proportion of species within a prey group of not fully identified prey items. The variable should be made from variable names in s, or constants.

dist_pred_size

Stratum used for predator size in constructing proportion of species within a prey group of not fully identified prey items. The variable should be made from variable names in s, or constants.

from_to_species

Allocation key for not fully identified prey species into identified species. See function make_from_to_species.

do_only

Do only redistribution for the selected steps.

selected_pred

Predators for which redistribution is done. All predators are included,if selected_pred value is missing.

remains_to_other

Convert not fully identified prey species to prey 'other' where no species allocation key can be found.

by_prey_size

Do the allocation by prey and prey size (by_prey_size=TRUE) or just by prey (by_prey_size=FALSE).

keep_size

Keep the size information of not redistributed items (keep_size=TRUE) or set size information to missing (keep_size=FALSE).

verbose

Logical, show details

Details

The function allocate partly identified preys into identified preys. A group of partly identified could for example be Clupeidae (herring like fish) which should be distributed according to the of observed proportion of identified preys within that group (e.g. herring and sprat). The parameter from_to_species specify which identified prey items that is included in a group of not fully identified prey items. from_to_species can include more than one group of partly identified groups, e.g. Clupeidae and Gadidae. See function the documentation for make_from_to_species.

Input data must include the variables stratum_time, stratum_sub_area and stratum_area. These variable are normally added by the the function add_strata.

The parameters dist_time, dist_area and dist_pred_size define the groups to be used for producing a prey allocation keys. The variables can either include a variable from the input data (e.g. dist_area could be set to rectangle) or be a constant, e.g. 'all'. Each combination of a distribution key of identified preys within prey group is made for for each combination of dist_time, dist_area and dist_pred_size and used to redistribute the the partly identified prey for each of the combinations.

As an example: The call redist_unidentified_prey_sp(b,dist_time=stratum_time,dist_area=stratum_sub_area,dist_pred_size=pred_size) uses the variable stratum_time and stratum_sub_area defined in the input set, to define groups to redistribution of partly identified preys. That means that only observations of identified preys within the each sub_area is used for redistribution, with the risk that there are no or few observation of fully identified preys, such that the distribution key becomes inadequate.

The call redist_unidentified_prey_sp(v,dist_time=stratum_time,dist_area=stratum_area,dist_pred_size=pred_size) does the same, but here is the groups defined from the larger stratum_area instead of strataum_sub_area. This will give more observations to make the distribution key, but will also use observations from a larger area.

The call redist_unidentified_prey_sp(v,dist_time=year,dist_area='ALL',dist_pred_size=pred_size) will use all observations (all available quarterly observations) within a year and all areas to make the distribution key used for redistribution.

Value

Stomach contents data of class STOMobs.

Examples

## Not run: x=2


MortenVinther/FishStomachs documentation built on Feb. 14, 2025, 7:33 a.m.