From 9dd231defa139d570f217322ace2c4fd874d15bd Mon Sep 17 00:00:00 2001 From: john Fieberg <55828175+nilanjanchatterjee@users.noreply.github.com> Date: Mon, 30 May 2022 09:17:51 -0500 Subject: [PATCH] updated Rfunction changed the window for the non-default version --- RFunction.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFunction.R b/RFunction.R index 36653a6..f81fa5b 100644 --- a/RFunction.R +++ b/RFunction.R @@ -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