diff --git a/shiny/shiny-calipseo/assets/country/LBN/compute_gfcm_task_II_2.R b/shiny/shiny-calipseo/assets/country/LBN/compute_gfcm_task_II_2.R new file mode 100644 index 00000000..bc6abb97 --- /dev/null +++ b/shiny/shiny-calipseo/assets/country/LBN/compute_gfcm_task_II_2.R @@ -0,0 +1,21 @@ +###compute_gfcm_task_II_2 +compute_gfcm_task_II_2<-function(ref_species,data){ + + data<-data%>% + group_by(EST_YEAR,EST_FS,EST_SPC)%>% + summarise(TOTAL_LANDING= sum(EST_LND_CATCH,na.rm=T), + TOTAL_DISCARDS = 0, + TOTAL_CATCH = sum(EST_LND_CATCH,na.rm=T) + )%>% + ungroup()%>% + mutate(COMMENT="", + GSA="27", + EST_SPC=as.character(EST_SPC))%>% + left_join(ref_species%>%select(ID,ASFIS_CODE)%>%mutate(ID=as.character(ID)),by=c('EST_SPC'='ID'))%>% + rename(FLEET_SEGMENT=EST_FS, + SPECIES=ASFIS_CODE)%>% + select(GSA,FLEET_SEGMENT,SPECIES,TOTAL_LANDING,TOTAL_DISCARDS,TOTAL_CATCH,COMMENT) + + return(data) + +} \ No newline at end of file