[chronojump] printRadar. Allows the time not to start at zero
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] printRadar. Allows the time not to start at zero
- Date: Tue, 26 Nov 2019 17:30:18 +0000 (UTC)
commit 5d6d31b4c344877cc6d38e193480c0f6d58d08d5
Author: Xavier Padullés <x padulles gmail com>
Date: Tue Nov 26 18:20:18 2019 +0100
printRadar. Allows the time not to start at zero
r-scripts/sprintRadar.R | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/r-scripts/sprintRadar.R b/r-scripts/sprintRadar.R
index f481356d..bbbfca47 100644
--- a/r-scripts/sprintRadar.R
+++ b/r-scripts/sprintRadar.R
@@ -50,6 +50,7 @@ getSprintFromRadar <- function(radFile, decimalSeparator = ",")
radar = radar[1:(length(radar[,1]) -1 ),] #Trim the last line
radar[,2] = as.numeric(gsub(",", "\\.", radar[,2])) #Substitute the comas by dots in the second
column
radar = data.frame(t = na.omit(radar[,2]), v= na.omit(radar[,3]), position = na.omit(radar[,5]))
+ radar$t = radar$t - radar$t[1]
#Adjusting the measured data to the model
model = nls( v ~ Vmax*(1-exp(-K*t)), radar, start=list(Vmax=10, K=1))
@@ -121,6 +122,7 @@ getRadarDynamicsFromFolder <- function(radDir, athletesFile, splitDistance, resu
skip = 18, #The first 18 lines are metadata of the
test
n = nlines - 19) #The last line contains "END OF FILE" So
it is discarded
radar = data.frame(t = na.omit(radar[,2]), v= na.omit(radar[,3]), position =
na.omit(radar[,5])) #Discarding NA values
+ radar$t = radar$t - radar$t[1]
options(warn = -1)
#Adjusting the measured data to the model of getSprintFromRadar
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]