-
Notifications
You must be signed in to change notification settings - Fork 1
Description
We need to add nets for it to be evaluated in case_when() for the nets gear type because it is among the gears in the Aina_ya_zana_ya_uvuvi column. Alternatively we can let TRUE evaluate to gear as in TRUE ~ gear instead of TRUE ~ NA_character_ so that if we missed any gear type in the broad categorization, it can fall to the gear type in the data.
I would prefer Option 2 unless you have any special reservations why Option 1 is better. The advantage of Option 1 is the ease of identifying gear types from the data that are off. The advantage of Option 2 is that we will always have a gear types shown in the dashboard no matter the circumstance.
Option 1
...
gear = dplyr::case_when(
.data$gear %in%
c(
"setnet",
...,
"nyavu",
...,
"nets"
) ~
"Nets",
...
Option 2
...
dplyr::mutate(
gear = dplyr::case_when(
.data$gear %in%
c(
"setnet",
...,
"trammel_net"
) ~
"Nets",
.data$gear %in% c("handline") ~ "Handline",
...,
.data$gear == "handline" ~ "Handline",
TRUE ~ gear #This will fall back into gear type in the data
)
...
Note: We intend to expand the nets categories in the future instead of lumping them altogether - will advise on that.
The issue was raised here
Kelvin