I've tried searching stack overflow for the answer but I couldn't get it.
I'm using a reversed y axis to plot one y variable over time and I wanted to get my secondary y axis in normal order (not reversed).
library(tidyverse)
library(scales)
library(lemon)
base_nivelprecip %>%
mutate(nivel = as.double(nivel),
precip = as.double(precip)) %>%
mutate(precip_rescaled = precip/200) %>%
ggplot(aes(x = data, y = nivel,
xmin = as.POSIXct("2012-05-01", "%Y-%m-%d"),
xmax = as.POSIXct("2020-04-30", "%Y-%m-%d"))) +
geom_col(aes(x = data, y = precip_rescaled), fill = '#8D8DAA', size = 3) +
geom_line(group = 1, color = '#041562', size = 0.3) +
labs(x = "", y = "Groundwater level (m)") +
scale_y_reverse(limits = c(5,-0.5) , sec.axis = sec_axis(~rev(.)*200, name = "Precipitation (mm)")) +
lemon::facet_rep_wrap(~poco, nrow = 3, repeat.tick.labels = TRUE) +
theme_bw() +
theme(text=element_text(size=12),
axis.text.x = element_text(size = 8)
Although I've tried some transformations, the best I could get was this:

But I wanted the geom_col (in secondary axis) to start at the secondary axis 0, not at the primary axis. Can somebody help me? Thanks. A sample of my data is here: https://docs.google.com/spreadsheets/d/1xgj3Gan1Lj9qO2aEGdLpiUOBk9g8USMS/edit?usp=sharing&ouid=111814647952336460862&rtpof=true&sd=true


head(dput(data), 20)?head(dput(base_nivelprecip), 10)or less is also possible.