Closed raegan13 closed 6 years ago
what about this? some of it might be superfluous but you could tweak.
reef_fish %>%
gather(`Museum.Bootless`, `Bootless`, key = "location", value = "catch_code") %>%
select(Family, Genus, species,location, catch_code, length..cm.) %>%
filter(catch_code == 1) %>%
group_by(Family, location) %>%
summarise(total_catch = sum(catch_code))
Thank you so much! This worked really well. In fact, displaying my data this way, I fixed up all my code and thereby fixed the issue I was having with my graphs!
Hi! I'm still encountering issues with trying to use Tidyr to manipulate my data. I think we discussed using spread(), so I'm attempting to spread my condensed dataset by Genus, but I just turn up with a lot of NAs. Is there a better way to use Tidyr to manipulate my data?