I am plotting multiple series of data on one plot.
I have data that looks like this:
count_id AMV Hour duration_in_traffic AMV_norm
1 16012E 4004 14 99 0
2 16012E 4026 12 94 22
3 16012E 4099 15 93 95
4 16012E 4167 11 100 163
5 16012E 4239 10 97 235
I am plotting in R using:
ggplot(td_results, aes(AMV,duration_in_traffic)) + geom_line(aes(colour=count_id))
This is giving me:
However, rather than straight lines linking points I would like curved.
I found the following question but got an unexpected output. Equivalent of curve() for ggplot
I used: ggplot(td_results, aes(AMV,duration_in_traffic)) + geom_line(aes(colour=count_id)) + stat_function(fun=sin)
Thus giving:
How can I get a curve with some form of higher order polynomial?