This function allows to check the coherence of a sampled species measure type according to its default measure type. Major tunas (YFT, BET, SKJ and ALB) could also be measured in PD1.

obs_sample_measure_type_control(sample)

Arguments

sample

data.frame expected. All samples during the time range selected.

Value

The function returns one data.frame.

Details

The input dataframe must contain all these columns for the function to work :

  • samplemeasure_id

  • species_faocode

  • sizetype_code

  • defaultsizetype_code

Note

Version 1.0

Author

Chloé Tellier, Esther Mollier, Philippe S. Sabarros

Examples

#Sample 1 is ok: the sample is a CNT measured in TL
#Sample 2 is ok: the sample is a FAL measured in TL
#Sample 3 is ok: the sample is a LKV measured in SCL
#Sample 4 is ok: the sample is a YFT measured in PD1
#Sample 5 is not ok: the sample is a FAL measured in FL
sample <- data.frame(samplemeasure_id = c("1", "2", "3", "4", "5"),
                     species_faocode = c("CNT", "FAL", "LKV", "YFT", "FAL"),
                     sizetype_code = c("TL", "TL", "SCL", "PD1", "FL"),
                     defaultsizetype_code = c("TL", "TL", "SCL", "FL", "TL"))
obs_sample_measure_type_control(sample)
#>   samplemeasure_id species_faocode sizetype_code defaultsizetype_code logical
#> 1                1             CNT            TL                   TL    TRUE
#> 2                2             FAL            TL                   TL    TRUE
#> 3                3             LKV           SCL                  SCL    TRUE
#> 4                4             YFT           PD1                   FL    TRUE
#> 5                5             FAL            FL                   TL   FALSE