ices-eg / RCGs

A place for the Regional Coordination Groups (RCGs) to store scripts (e.g. for map-plotting, age-length relationships) to make them available to other groups and improve the development and exchange.
7 stars 8 forks source link

Erosquesada #163

Closed erosquesada closed 1 year ago

erosquesada commented 1 year ago

Update to code regarding the R Shiny application ("RCGs/RegionalOverviews/overviews_shiny" segment).

Changes include:

  1. Pop-ups with various stats in the interactive map.
  2. Addition of Catch category filter in the interactive map tab.
  3. Inclusion of TR inventory table on the inventory table tab.
  4. Inclusion of an app.R file that launch the app by calling directly the relevant scripts.
  5. Formatting of some scripts and inclusion of some explanations.
  6. Debugging in order to allow the app accommodate last year (i.e. 2022) data.

Changes were introduced in:

  1. "RCGs/RegionalOverviews/overviews_shiny/server/tab_interactive.R"
  2. "RCGs/RegionalOverviews/overviews_shiny/server/tab_interactive.R"
  3. "RCGs/RegionalOverviews/overviews_shiny/server/tab_inventory.R" and "RCGs/RegionalOverviews/overviews_shiny/ui.R"
  4. "RCGs/RegionalOverviews/overviews_shiny/app.R"
  5. "RCGs/RegionalOverviews/overviews_shiny/ui.R" "RCGs/RegionalOverviews/overviews_shiny/server.R", "RCGs/RegionalOverviews/overviews_shiny/global.R", "RCGs/RegionalOverviews/overviews_shiny/ui.R",
    "RCGs/RegionalOverviews/overviews_shiny/server/tab_interactive.R", "RCGs/RegionalOverviews/overviews_shiny/server/tab_inventory.R", "RCGs/RegionalOverviews/overviews_shiny/server/general_settings.R"
  6. "RCGs/RegionalOverviews/overviews_shiny/server/tab_inventory.R"

Changes were introduced by:

  1. Summarizing the data filtered based on the user selection for each latitude and longitude coordinates with different code that allows the information on statistic displayed in the pop-up to be stored. The latter pop-ups added to the Leaflet markers.
  2. Adding a new input in the sampling explorer of the interactive map tab.
  3. Adding a new panel to the user interface and set up the table so that data are aggregated for "VesselIdentifier" and "Harbour" (among others variables shared with the other two inventory tables) to calculate the number of fish measured, number of trip with length samples, weight.
  4. Creating a new file that launch the application by calling relevant scripts.
  5. Simple formatting of scripts and addition of headers with explanations potentially useful to save time for others working for the first time on these files.
  6. "NA" character in the data relative to 2022 and in particular in the StatisticalRectangle column of key df was not recognized and thus led to initially unexplained crashes when feeding the app with data from different years, fixed by identifying these values explicitly.

Changes were tested by:

Important bugs to solve: