Skip to content

Commit

Permalink
updated Rfunction
Browse files Browse the repository at this point in the history
changed the window for the non-default version
  • Loading branch information
nilanjanchatterjee authored May 30, 2022
1 parent afbec6e commit 9dd231d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RFunction.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ rFunction <-function(data, threshold=NULL, window=72){
# it matches with the distance column for actual speed calculation
data_temp$timediff <- magic::shift(data_temp$timediff, -1)
data_temp <-data_temp %>% mutate(speed = distance/as.numeric(timediff)) %>%
mutate(rollm =rollapply(speed, 72/median(as.numeric(timediff), na.rm=T), mean, na.rm=T, fill=NA))
mutate(rollm =rollapply(speed, window/median(as.numeric(timediff), na.rm=T), mean, na.rm=T, fill=NA))
##moving average to be calculated over the window time

### Input condition for the clustering
Expand Down

0 comments on commit 9dd231d

Please sign in to comment.