ices-tools-dev / RDBESvisualise

GNU General Public License v3.0
0 stars 1 forks source link

produceSamplingCoverage function #11

Open erosquesada opened 1 year ago

erosquesada commented 1 year ago

output from WGRDBES-EST 2023.

This function requires the user to specify data containing the sampling information and a database for contrast (one of landing or effort data). The user should also specify type of comparison and a resolution of the comparison as follows:

  - Spatial:
  i.    ICES Subdivision
  ii.   ICES Rectangle
  - Time: 
  i.    Year
  ii.   Semester
  iii.  Quarter
  iv.   Month 
  - Fleet:
  i.    Scale of the fishery (length vessel discriminate large and small) . 
  ii.       Gear [will be needed to extract it from the metier in CL]  
  - Species:
  i.    Species list
  ii.   Group list (e.g. Cephalopods). 

The parameters of this function are:

RDBESobj    = RDBESobject to be explored. 
var = weight sampled/number samples/individuals sampled. 
contrastVar = is a variable related to landing or effort selected by the user. 
by =  One (or more) factor(s) to split the data. 
type =  one of spatial, time, fleet, species. 
resolution = is conditional on type. 
year = year(s) to filter the data. 
output_type = one of table | plot. 

The function output provides information on the distribution of the number of samples versus landing or effort unit across the levels of the factors selected by the user. If output_type == “table” the output is a table. If output_type == “plot” the output is an heatmap. If the type == “effort”, the output consist of one plot illustrating the number of sampled trips versus the number of trips that were performed by the fleet. If the type == “landing”, the output consists of two plots:

erosquesada commented 4 weeks ago

Update WGRDBES-EST 2024

The function was amended during WGRDBES-EST 2024. The main edits were related to:

The current output of the function, when compiled as follows, is shown below.

produceSamplingCoverage(
  rdbesobj,
  var = "SAsampWtLive",
  contrastVar = "CLoffWeight",
  by = NA,
  type = "Spatial",
  resolution ="ICES Rectangle",
  year = NA,
  quarter = NA, 
  vesselFlag = NA, 
  catchCat = NA, 
  showSamples = T,
  output_type = NA, 
  verbose = T
)

example_produceSamplingCoverage_function_zwData

This combination (type = "Spatial" x resolution = "ICES Rectangle") still requires to be improvement with regards to:

In summary, the type x resolution developed so far for this function are:

With regards to the fleet type, for future development, please note that @JulBond may provide some useful code.