Closed raegan13 closed 6 years ago
not exactly what you are looking for but I pushed code to count each fish from each genus at each site.
#count fish at each site based on genus, listing number of species
group_by(reef_fish_bootless, Genus) %>%
summarise(
bootless = sum(Bootless),
Museum.Bootless = sum(Museum.Bootless),
n_species = n())
More directly you could filter rows based on value > 0 and count number of rows for each location
Great, thanks for the help!
Next question: I want to filter out rows that are only 0 for both Bootless and Museum.Bootless, but not rows that read 0 for only one location. Is there a way to use filter() for conditions like this?
dataset %>%
filter(Bootless == 1 & Museum.Bootless == 1)
or
dataset %>%
filter(Bootless != 0 & Museum.Bootless != 0)
Thanks so much! I figured out a way to do it using "|".
In my question, I'm attempting to compare the amount of species present in Bootless Bay and the Museum Bootless collection. The data notes absence/presence of each species as 0/1. I'm having a really hard time thinking of how I can graph this data effectively. Does anyone have an idea of what I could do?