I want some figure like this two geom_riboon from: https://doi.org/10.1016/j.neuroimage.2019.116060
This is head of my data:
time mean sem class
1 -200 -0.03459213 0.002035373 n
2 -196 -0.03065102 0.001801943 n
3 -192 -0.02696143 0.001602451 n
4 -188 -0.02354627 0.001436726 n
5 -184 -0.02040872 0.001302610 n
6 -180 -0.01753815 0.001196551 n
I wrote this code:
ggplot(df, aes(time,
color = class)) +
geom_line(mapping = aes(y = mean))
geom_ribbon(aes(y = mean,
ymin = mean - sem,
ymax = mean + sem,
color = class))
But it doesn't create shaded area and I only see the mean line.