Im trying to make a growth curve with 2 variables on the same plot (Media1 and Media2). I have 3 time points (T1,T2...) and each time point was repeated 3 times (R1,R2,R3). I need to average the replicates and make a line graph with error bars. Example of the data:
Time Replicate Media1 Media2
1 T0 R1 0.013733333 0.03770000
2 T0 R2 0.008233333 0.03690000
3 T0 R3 0.013333333 0.03760000
4 T1 R1 0.018166667 0.03680000
5 T1 R2 0.013466667 0.03570000
6 T1 R3 0.018366667 0.03700000
7 T2 R1 0.028066667 0.04420000
8 T2 R2 0.022966667 0.04400000
9 T2 R3 0.027866667 0.04420000
10 T3 R1 0.041333333 0.05536667
11 T3 R2 0.033433333 0.05476667
12 T3 R3 0.039833333 0.05446667
I have figured out how to average the replicates using this:
.colMeans(df$Media1, 3, length(df$Media1) / 3)
And I know how to plot it in ggplot. I just can't figure out how to get error bars on the line graph from the original non-averaged data.
Thanks for any help