Level 2 of t3 process (samples standardisation).

t3_level2(
  object_model_data,
  object_full_trips,
  maximum_lf_class = as.integer(500),
  threshold_rf_minus10 = as.integer(500),
  threshold_rf_plus10 = as.integer(500),
  threshold_frequency_rf_minus10 = as.integer(75),
  threshold_frequency_rf_plus10 = as.integer(75),
  threshold_rf_total = as.integer(250),
  log_file = FALSE,
  log_path = NULL,
  log_name = "t3_level2",
  output_path = NULL,
  new_directory = FALSE,
  integrated_process = FALSE,
  referential_template = "observe"
)

Arguments

object_model_data

Object of classes object_model_data and R6 expected.

object_full_trips

Object of classes full_trips, list_t3 and R6 expected.

maximum_lf_class

Object of type integer expected. Theorical maximum lf class that can occur (all species considered). By default 500.

threshold_rf_minus10

Object of type integer expected. Threshold limit value for raising factor on individuals category minus 10. By default 500.

threshold_rf_plus10

Object of type integer expected. Threshold limit value for raising factor on individuals category plus 10. By default 500.

threshold_frequency_rf_minus10

Object of type integer expected. Threshold limit frequency value for raising factor on individuals category minus 10. By default 75.

threshold_frequency_rf_plus10

Object of type integer expected. Threshold limit frequency value for raising factor on individuals category plus 10. By default 75.

threshold_rf_total

Object of type integer expected. Threshold limit value for raising factor (all categories). By default 250.

log_file

Object of type logical expected. Initiation or not for log file creation. By default FALSE (no).

log_path

Object of type character expected. Path of the log file directory. By default NULL.

log_name

Object of type character expected. Name of the log file. By default "t3_level2".

output_path

Object of class character expected. Outputs path directory. By default NULL.

new_directory

Object of class logical expected. Initiate a new outputs directory of use an existing one. By default NULL.

integrated_process

Object of class logical expected. Indicate if the process is integrated in another (like the one in the function "t3_process"). By default FALSE.

referential_template

Object of class character expected. By default "observe". Referential template selected (for example regarding the activity_code). You can switch to "avdth".

Value

The function return a R6 reference object named "object_full_trips" of class full_trips.

Details

If a output_path is specified, the following output is extracted and saved in ".csv" format under the path: "global_output_path/level2/data/".

  • Process 2.1: sample length class conversion from ld1 (first dorsal length) to lf (fork length) (full_trips$sample_length_class_ld1_to_lf()): process_2_1 a table (.csv) with as many rows as elementary samples raw, plus the elementary samples raw created by certain conversions from LD1 TO LF classes, and 16 columns:

    • full_trip_id: retained full trip id, type integer.

    • full_trip_name: full trip id, type integer.

    • trip_id: trip identification (unique topiaid from database), type character.

    • trip_end_date: trip end date, type character.

    • year_trip_end_date: year of trip end, type integer.

    • vessel_code: vessel code, type integer.

    • vessel_type_code: vessel type code, type integer.

    • well_id: well identification (unique topiaid from database (ps_logbook.well in Observe)), type character.

    • sample_id: sample identification (unique topiaid from database (ps_logbook.sample in Observe)), type character.

    • sub_sample_id: sub-sample identification number, type integer.

    • elementarysampleraw_id: elementarysampleraw identification (unique topiaid from database (ps_logbook.samplespeciesmeasure in Observe)), type character.

    • species_fao_code: species FAO code, type character.

    • sample_length_class: sample length class (cm) of measured individuals in first dorsal length (LD1), type numeric.

    • sample_number_measured: sample number of measured individuals in first dorsal length (LD1), type integer.

    • sample_length_class_lf: sample length class (cm) of measured individuals converted in curved fork length (LF), type numeric.

    • sample_number_measured_lf: sample number of measured individuals converted for curved fork length (LF) distribution, type numeric. For example, for one sample (sample_number_measured=1) from the Atlantic Ocean (1), of the species YFT (Thunnus albacares), with a first dorsal length class (LD1) measured at sample_length_class=8 (cm), the LD1 to LF conversion will create a new elementary sample row because a percentage of ratio=50 % of the number of fish in the sample will be assigned to the curved fork length class: sample_number_measured_lf=32 (cm) (sample_number_measured_lf=0.5) and 50% of this sample will obtain a sample_number_measured_lf=34 (cm) with sample_number_measured_lf=0.5.

  • Process 2.2 Extrapolation of the number of individuals measured in the sample to the number of individuals counted (full_trips$sample_number_measured_extrapolation()): process_2_2: a table (.csv) with as many rows as elementary samples raw, plus the elementary samples raw created by certain conversions from LD1 TO LF classes, and 17 columns:

    • full_trip_id: retained full trip id, type integer.

    • full_trip_name: full trip id, type integer.

    • trip_id: trip identification (unique topiaid from database), type character.

    • trip_end_date: trip end date, type character.

    • year_trip_end_date: year of trip end, type integer.

    • vessel_code: vessel code, type integer.

    • vessel_type_code: vessel type code, type integer.

    • well_id: well identification (unique topiaid from database (ps_logbook.well in Observe)), type character.

    • sample_id: sample identification (unique topiaid from database (ps_logbook.sample in Observe)), type character.

    • sub_sample_id: sub-sample identification number, type integer.

    • sub_sample_total_count_id: sub sample identification bis in relation with the fish total count (unique topiaid from database (ps_logbook.samplespecies in Observe)), type character.

    • elementarysampleraw_id: elementarysampleraw identification (unique topiaid from database (ps_logbook.samplespeciesmeasure in Observe)), type character.

    • species_fao_code: species FAO code, type character.

    • sample_length_class_lf: sample length class (cm) of measured individuals converted in curved fork length (LF), type numeric.

    • sample_number_measured_lf: sample number of measured individuals converted for curved fork length (LF) distribution, type numeric.

    • sample_total_count: total number of individuals counted for this sample, type integer.

    • sample_number_measured_extrapolated_lf: sample number of measured individuals (converted in LF) extrapolated to the sample number of counted individuals, type numeric.
      sample_number_measured_extrapolated_lf=sample_number_measured_lf x rf4.

  • Process 2.3 Standardization of sample length classes step (full_trips$sample_length_class_step_standardisation()): process_2_3: a table (.csv) with as many rows as elementary samples, and 17 columns:

    • full_trip_id: retained full trip id, type integer.

    • full_trip_name: full trip id, type integer.

    • trip_id: trip identification (unique topiaid from database), type character.

    • trip_end_date: trip end date, type character.

    • year_trip_end_date: year of trip end, type integer.

    • vessel_code: vessel code, type integer.

    • vessel_type_code: vessel type code, type integer.

    • well_id: well identification (unique topiaid from database (ps_logbook.well in Observe)), type character.

    • sample_id: sample identification (unique topiaid from database (ps_logbook.sample in Observe)), type character.

    • sample_type_code: sample type type code, type integer.

    • sample_quality_code: sample quality code, type integer.

    • sub_sample_id: sub-sample identification number, type integer.

    • species_fao_code: species FAO code, type character.

    • sample_total_count: total number of individuals counted for this sample, type integer.

    • sample_standardised_length_class_lf: standardised sample length class (cm) in curved fork length (LF), according to the species and step associated, type numeric.

    • sample_number_measured_extrapolated_lf: standardised sample number of measured individuals (converted in LF and extrapolated in step 2.2, type numeric) .

  • Process 2.4 Distribution of weights from well scale to set scale (full_trips$well_set_weight_categories()): process_2_4: a table (.csv) with as many rows as elementary samples, and 12 columns:

    • full_trip_id: retained full trip id, type integer.

    • full_trip_name: full trip id, type integer.

    • trip_id: trip identification (unique topiaid from database), type character.

    • trip_end_date: trip end date, type character.

    • year_trip_end_date: year of trip end, type integer.

    • vessel_code: vessel code, type integer.

    • vessel_type_code: vessel type code, type integer.

    • well_id: well identification (unique topiaid from database (ps_logbook.well in Observe)), type character.

    • activity_id: activity identification (unique topiaid from database (ps_logbook.activity in Observe)), type character.

    • weighted_weight_minus10: weighted catch weight of individuals in the less than 10 tonnes category (by well, in tonnes, considering all species), type numeric.

    • weighted_weight_plus10: weighted catch weight of individuals in the over 10 kg category (by well, in tonnes, considering all species), type numeric.

    • weighted_weight: weighted catch weight (WW) of individuals (less and more 10kg categories, by well, in tonnes, considering all species), which represents the weight of a set in a well, type numeric.

  • Process 2.5 Creation of object standardised sample (full_trips$standardised_sample_creation()): process_2_5: a table (.csv) with as many rows as standardized samples, and 12 columns:

    • full_trip_id: retained full trip id, type integer.

    • full_trip_name: full trip id, type integer.

    • trip_id: trip identification (unique topiaid from database), type character.

    • trip_end_date: trip end date, type character.

    • year_trip_end_date: year of trip end, type integer.

    • vessel_code: vessel code, type integer.

    • vessel_type_code: vessel type code, type integer.

    • well_id: well identification (unique topiaid from database (ps_logbook.well in Observe)), type character.

    • sample_id: sample identification (unique topiaid from database (ps_logbook.sample in Observe)), type character.

    • species_fao_code: species FAO code, type character.

    • sample_standardised_length_class_lf: standardized sample length class in curved fork length (LF) (cm), type numeric.

    • sample_number_measured_extrapolated_lf: standardized sample number of measured individuals (converted in LF and extrapolated to all counted individuals), type numeric.

  • Process 2.6 Creation of object standardised sample set (full_trips$standardised_sample_set_creation()): process_2_6: a table (.csv) with as many rows as , and 15 columns:

    • full_trip_id: retained full trip id, type integer.

    • full_trip_name: full trip id, type integer.

    • trip_id: trip identification (unique topiaid from database), type character.

    • trip_end_date: trip end date, type character.

    • year_trip_end_date: year of trip end, type integer.

    • vessel_code: vessel code, type integer.

    • vessel_type_code: vessel type code, type integer.

    • well_id: well identification (unique topiaid from database (ps_logbook.well in Observe)), type character.

    • sample_id: sample identification (unique topiaid from database (ps_logbook.sample in Observe)), type character.

    • species_fao_code: species FAO code, type character.

    • sample_standardised_length_class_lf: standardized sample length class in curved fork length (LF) (cm), type numeric.

    • sample_number_weighted: sample number of measured individuals weighted by set weight, after conversion in LF and extrapolation to all counted individuals, type numeric.
      sample_number_weighted = sample_number_measured_extrapolated_lf * PWW.

    • sample_weight_unit: weight (kg) of one individual, calculated using length weight relationships as in Referential LWR table: sample_weight_unit = parameter_a * sample_standardised_length_class_lf ^ parameter_b), type numeric.

    • sample_weight: weight (kg) of all measured individuals weighted by set weight, after conversion in LF and extrapolation to all counted individuals, type numeric.
      sample_weight = sample_weight_unit * sample_number_weighted.

    • sample_category: sample category ("-10kg" or "+10kg"), according to sample_weight_unit value, type character.

  • Process 2.7 Raised factors determination to check relevance of the object standardized sample set (full_trips$raised_factors_determination()):
    process_2_7: a table (.csv) with as many rows as , and 13 columns:

    • full_trip_id: retained full trip id, type integer.

    • full_trip_name: full trip id, type integer.

    • trip_id: trip identification (unique topiaid from database), type character.

    • trip_end_date: trip end date, type character.

    • year_trip_end_date: year of trip end, type integer.

    • vessel_code: vessel code, type integer.

    • vessel_type_code: vessel type code, type integer.

    • well_id: well identification (unique topiaid from database (ps_logbook.well in Observe)), type character.

    • activity_id: activity identification (unique topiaid from database (ps_logbook.activity in Observe)), type character.

    • weighted_samples_minus10: weight of sampled individuals (tonnes), for weight category (\(\leq\) 10kg, type numeric.

    • weighted_samples_plus10: weight of sampled individuals (tonnes), for weight category > 10kg, type numeric.

    • weighted_samples_total: weight of sampled individuals (tonnes), for all weight categories (\(\leq\) 10kg and > 10kg), type numeric.

    • rf_validation: raising factor status, type integer.

    • rf_validation_label: raising factor status label, type character.

  • Process 2.8 Application of raised factors calculated in process 2.7 on standardised sample set (full_trips$raised_standardised_sample_set()):
    process_2_8: a table (.csv) with as many rows as , and 14 columns:

    • full_trip_id: retained full trip id, type integer.

    • full_trip_name: full trip id, type integer.

    • trip_id: trip identification (unique topiaid from database), type character.

    • trip_end_date: trip end date, type character.

    • year_trip_end_date: year of trip end, type integer.

    • vessel_code: vessel code, type integer.

    • vessel_type_code: vessel type code, type integer.

    • well_id: well identification (unique topiaid from database (ps_logbook.well in Observe)), type character.

    • activity_id: activity identification (unique topiaid from database (ps_logbook.activity in Observe)), type character.

    • sample_id: sample identification (unique topiaid from database (ps_logbook.sample in Observe)), type character.

    • species_fao_code: species FAO code, type character.

    • sample_standardised_length_class_lf: standardized sample length class in curved fork length (LF), (cm), type numeric.

    • sample_number_weighted_set: sample number weighted by set, type numeric.
      sample_number_weighted_set = sample_number_weighted * rf, where :

      • rf: is one of the raising factors calculated in the process 2.7, according to sample weight category (\(\leq\) 10kg and > 10kg).

      • sample_number_weighted: is the sample number of measured individuals weighted by set weight, after conversion in LF and extrapolation to all counted individuals, calculated in the process 2.6.

    • sample_weight_set: sample weight by set (tonnes), type numeric.
      sample_weight_set = sample_weight_unit/1000 * sample_number_weighted_set