Hello, I am using this to create my graph but I need that the HN stays over the HS, and Iam not getting it. And let the color be red instead of blue.
library(tidyverse, quietly = TRUE)
binary_data <- data.frame(stringsAsFactors=FALSE,
Species = c("Lutajnus synagris", "Lutjanus analis", "Lutjanus apodus",
"Lutjanus cyanopterus", "Lutjanus griseus", "Lutjanus jocu",
"Ocyurus chysurus", "Lutjanus analis", "Lutajnus jocu", "Lutjanus gibbus",
"Lutjanus fulvus", "Symphorichthys spilurus", "Lutjanus bohar"),
hemisphere = c("HN", "HN", "HN", "HN", "HN", "HN", "HN", "HS", "HS", "HS",
"HS", "HS", "HS"),
spring = c(1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1),
summer = c(1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1),
fall = c(0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1),
winter = c(0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1)
)
binary_data %>%
gather(Season, Presence, spring:winter) %>%
group_by(hemisphere, Season) %>%
summarise(species_count = sum(Presence)) %>%
ggplot(aes(x = Season, y = hemisphere)) +
geom_point(aes(size = species_count, color = species_count)) +
scale_size_continuous(range = c(3,18)) +
guides(colour = guide_legend()) +
labs(color = 'Number of Species',
size = 'Number of Species') +
theme_minimal()