Re: [R] how to allign data

2018-08-03 Thread PIKAL Petr
> From: Jim Lemon > Sent: Friday, August 3, 2018 12:32 AM > To: PIKAL Petr > Cc: r-help mailing list > Subject: Re: [R] how to allign data > > Hi Petr, > I recently had to align the minima of deceleration events to form an > aggregate "braking profile" for

Re: [R] how to allign data

2018-08-02 Thread Jim Lemon
Hi Petr, I recently had to align the minima of deceleration events to form an aggregate "braking profile" for different locations. It seems as though you are looking for something like: find_increase<-function(x,surround=10) { inc_index<-which.max(diff(x)) indices<-(inc_index-surround):(inc_inde