Hi I am using
ggpmisc to look for peaks in time series data.
It is a biosignal dataset.
I use something like.....
p<- ggplot(data, aes(x=time, y=V2.)) + geom_line()
p2<- p + stat_peaks(colour = "blue", span = 21, ignore_threshold = 0.8)
p2
p3<- p2 + stat_peaks(geom = "text", colour = "red", span = 21, ignore_threshold = 0.8,
hjust = -0.1, angle = 90)
p3
p4<- p3 +stat_valleys(colour = "green", span = 59, ignore_threshold = 0.3)
to get the points I want which I can visually see and am happy with
looks like the attached file.
Does anyone know how to get the values of these markers, other than copying the text on the graph and putting them into a CSV file?
I have over 100 such files to analyse, and then I want to do some R maths on the CSV files ie. for each file subtract the high blue peaks from the lower ones, and the time from lower blue peak to green etc etc etc. So I really need the time stamps of these dots.
Any help
Most Welcome
BW
Neil