I have a data frame of this type
YEAR MONTH DAY HOUR LON LAT
1860 10 3 13 -19.50 3.00
1860 10 3 17 -19.50 4.00
1860 10 3 21 -19.50 5.00
1860 10 5 5 -20.50 6.00
1860 10 5 13 -21.50 7.00
1860 10 5 17 -21.50 8.00
1860 10 6 1 -22.50 9.00
1860 10 6 5 -22.50 10.00
1860 12 5 9 -22.50 -7.00
1860 12 5 18 -23.50 -8.00
1860 12 5 22 -23.50 -9.00
1860 12 6 6 -24.50 -10.00
1860 12 6 10 -24.50 -11.00
1860 12 6 18 -24.50 -12.00
What I wold like to do is to calculate the interpolating line for every subset of temporally close points (e.g. temporal difference between consecutive points is less than 4 days; in the example above there are 2 subset: one from 1860-10-3 till 1860-10-6 and the other from 1860-12-5 till 1860-12-6) and then create an extra column with the fit correlation coefficient associate with the respective subset interpolating line.
The problem is that I don't know how to subset my data frame properly according to the criteria stated above.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…