My dataset:
reading,depth
31055,0.0
57635,0.5
34268,1.0
20926,1.5
13507,2.0
12944,2.5
13002,3.0
12892,3.5
12610,4.0
12158,4.5
12004,5.0
I\'m pl
I may be wrong, but I think you probably want something like this:
dat %>%
ggplot(aes(x = depth, y = reading)) +
geom_path() +
stat_smooth() +
theme_classic() +
scale_x_reverse() +
scale_y_continuous(position = "top") +
coord_flip()
which produces
For this, you're running the smooth with depth on the x
and reading on the y
, then flipping the coordinates.