library(tidyverse)
# library(ryouwithme) # not found
library(RColorBrewer)
rain_temp_bugs <- readr::read_csv("https://raw.githubusercontent.com/rladiessydney/RYouWithMe/master/sydneybeaches.csv")
#> Rows: 3690 Columns: 8
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (4): Region, Council, Site, Date
#> dbl (4): BeachId, Longitude, Latitude, Enterococci (cfu/100ml)
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# analogous to OP
rain_temp_bugs %>% # data set from RYouWithMe package
na.omit() %>%
# filter(beachbugs > 500) %>%
ggplot(
aes(
x = BeachId,
y = Latitude,
colour = `Enterococci (cfu/100ml)`
)
) +
geom_point() +
geom_smooth() +
scale_color_distiller(palette = "YlOrBr")
#> `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

# analogous to OP, but order reversed
rain_temp_bugs %>% # data set from RYouWithMe package
na.omit() %>%
# filter(beachbugs > 500) %>%
ggplot(
aes(
x = BeachId,
y = Latitude,
colour = `Enterococci (cfu/100ml)`
)
) +
geom_point() +
geom_smooth() +
scale_color_distiller(palette = "YlOrBr", direction = 1,)
#> `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'
