Code
data(bshydro15, package = "marinedata")
summer <- bshydro15 |>
mutate(month = factor(month.abb[month], levels = month.abb)) |>
filter(month %in% c("May", "Jun", "Jul", "Aug"))
a <- summer |>
filter(pres <= 5) |>
select(sampling_id, month) |>
distinct() |>
ggplot(aes(x = month)) +
geom_bar(aes(fill = month)) +
guides(fill = "none") +
scale_fill_brewer(palette = "Set1") +
guides(x = guide_axis(angle = 90)) +
labs(x = "Month", y = "Measurements") +
theme_classic()
b <- summer |>
group_by(ices_sd, station, lat, long, date_time, month, day) |>
summarise(psal = mean(psal, na.rm = TRUE), .groups = "drop") |>
drop_na() |>
ggplot(aes(x = long, y = psal, col = ices_sd)) +
geom_point() +
scale_colour_brewer(palette = "Paired") +
guides(colour = "none") +
labs(x = "Longitude", y = "Salinity") +
theme_classic()
c <- summer |>
filter(month %in% c("May", "Aug")) |>
ggplot(aes(long,lat))+
geom_point(aes(colour = temp)) +
scale_colour_gradient(low = "white", high = "red") +
facet_grid(. ~ month) +
labs(x = "Longitude", y = "Latitude", col = "Temperature (°C)") +
theme_classic()

































