change_data: Make changes on STOMobs from user options

View source: R/change_data.R

change_dataR Documentation

Make changes on STOMobs from user options

Description

Change stomach data

Usage

change_data(
  stom,
  delete_vars,
  control_criteria = FALSE,
  pred_weight_multiplier = 1,
  pred_length_multiplier = 1,
  prey_weight_multiplier = 1,
  prey_length_multiplier = 1,
  insert_quarter = TRUE,
  correct_nstom = TRUE,
  correct_predl = TRUE,
  correct_preyl = TRUE,
  add_weight_method = FALSE,
  add_record_type = TRUE,
  reorganize_keys = FALSE
)

Arguments

stom

Stomach data set of class STOMobs.

delete_vars

vector of variable names to be deleted.

control_criteria

dplyr::select sub-set of data from criteria given in control. That is criteria given by the slots predators, years, stratum_areas and stratum. See STOMcontrol.

pred_weight_multiplier

Multiplier for predator body weight, eg.g from kg to grammes.

pred_length_multiplier

Multiplier for predator body length, from cm to mm.

prey_weight_multiplier

Multiplier for prey body weight.

prey_length_multiplier

Multiplier for prey body length.

insert_quarter

Insert quarter of the year field from date.

correct_nstom

Insert values for number of stomachs (total, with food, regurgitated, empty) where missing.

correct_predl

Insert "missing" control@mis_l values for predator length range (pred_ll and pred_lu) from pred_l where missing. Insert missing pred_l from mean of pred_ll and pred_lu.

correct_preyl

Insert "missing" control@mis_l values for prey length (prey_l) and range of prey (prey_ll and prey_lu) where missing.

add_weight_method

Add code,if missing, for method of weighing and recording the weights of preys item (r=by record, p=by prey species and digestion stage).

add_record_type

Add code, if missing, for sampling method for stomachs (SS=Single stomachs, PS=Pooled stomachs).

reorganize_keys

Change internal keys (sample_id, fish_id). Do not change into TRUE!.

Value

STOMobs object.

Examples

## Not run: read_exchange_data(stom_dir = 'NorthSea', exchange_file = 'cod_stomachs_2017.dat')

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