I want to create a plot in ggplot showing the water level of a tidal system over a time span of several days. I have the water levels for each High and Low Tide, but when I plot them in ggplot the line looks edgy and I would like it to look curvy. I tried to use geom_smooth but that will not work. Has someone any idea?
+---------------+-------------+
| Water.level_m | Time_h |
+---------------+-------------+
| 3.9 | 0 |
| 1.4 | 0.270833333 |
| 3.8 | 0.516666667 |
| 1.5 | 0.7875 |
| 3.7 | 1.041666667 |
| 1.7 | 1.308333333 |
| 3.9 | 1.5625 |
| 1.7 | 1.829166667 |
| 3.6 | 2.091666667 |
| 1.8 | 2.35 |
| 3.8 | 2.608333333 |
| 1.7 | 2.875 |
| 3.6 | 3.141666667 |
| 1.8 | 3.4 |
| 3.9 | 3.654166667 |
| 1.6 | 3.9375 |
| 3.8 | 4.191666667 |
| 1.6 | 4.454166667 |
| 4.1 | 4.704166667 |
| 1.3 | 4.9875 |
| 4.2 | 5.245833333 |
| 1.2 | 5.504166667 |
| 4.4 | 5.75 |
| 0.9 | 6.025 |
| 4.5 | 6.275 |
| 0.8 | 6.5375 |
| 4.8 | 6.7875 |
| 0.6 | 7.058333333 |
| 4.8 | 7.308333333 |
| 0.5 | 7.566666667 |
| 5 | 7.816666667 |
| 0.4 | 8.083333333 |
| 5 | 8.3375 |
| 0.2 | 8.6 |
| 5.2 | 8.85 |
| 0.2 | 9.108333333 |
| 5.1 | 9.3625 |
| 0.1 | 9.625 |
| 5.2 | 9.879166667 |
| 0.2 | 10.14166667 |
| 5.1 | 10.39166667 |
+---------------+-------------+
You could use
spline()
to interpolate your original data points: