Hello everybody,
First of all, thanks for your help, and I hope I will understandable. I'm a french PhD student in human movement science, and I began with "R" 4 months ago. Then, I'm new on this website and I hope I ask the question in the correct section.
I give you my R code and I explain my problem :
# Show curve on a graphic with raw datas
plot(s9g_c_cor2$pupil_timestamp_secondes2 , s9g_c_cor2$diameter_3d , type='l' , xlab="secondes" , ylab="diamètre pupille" , col="royalblue3" , main="Evolution diamètre pupillaire")
# Show the smooth curve on graphic from raw datas
lines(smooth.spline(s9g_c_cor2$pupil_timestamp_secondes2 , s9g_c_cor2$diameter_3d),col="green",lwd=2)
This above code is correct (I can run it on R and it works, nevertheless I can't control the intensity of smoothing). However, now, I want to extract datas from the smooth curve. I tried differents code but it doesn't works (I give you, maybe, the code who is the most near to the good result, but maybe all is wrong and it's not the right way) :
library(tidyverse)
smoothcurvedatas = ggplot(data = s9g_c_cor2, aes(x = pupil_timestamp_secondes2, y = diameter_3d)) +
geom_point() +
geom_smooth(span = 0)
print(courbelisse)
To give an abstract, currently, I have raw datas in my first column of my dataframe "s9g_c_cor2" and now, I want to create in my dataframe a new column from datas smooth from the curve.
Thank you an other once for your help.
Yours sincerely,
GIOVANNANGELI Cyril