[chronojump] exportSprintDynamics separated in two, to be able to write.csv or just return a list
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] exportSprintDynamics separated in two, to be able to write.csv or just return a list
- Date: Thu, 4 Mar 2021 11:23:00 +0000 (UTC)
commit d9c168d7765e35793a327bace88d9d4c350a2a9a
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Mar 4 12:21:36 2021 +0100
exportSprintDynamics separated in two, to be able to write.csv or just return a list
r-scripts/sprintUtil.R | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/r-scripts/sprintUtil.R b/r-scripts/sprintUtil.R
index 85367f52..1aa3a486 100644
--- a/r-scripts/sprintUtil.R
+++ b/r-scripts/sprintUtil.R
@@ -99,7 +99,12 @@ getDynamicsFromSprint <- function(K, Vmax, Mass, T0 = 0, Temperature = 25, Heigh
exportSprintDynamics <- function(sprintDynamics)
{
- exportData = list(Mass = sprintDynamics$Mass,
+ exportRow = exportSprintDynamicsPrepareRow (sprintDynamics)
+ exportSprintDynamicsWriteRow (exportRow)
+}
+exportSprintDynamicsPrepareRow <- function(sprintDynamics)
+{
+ return(list(Mass = sprintDynamics$Mass,
Height = sprintDynamics$Height,
Temperature = sprintDynamics$Temperature,
Vw = sprintDynamics$Vw,
@@ -120,8 +125,11 @@ exportSprintDynamics <- function(sprintDynamics)
F0.rel = sprintDynamics$F0.rel,
V0 = sprintDynamics$V0,
pmax.lm = sprintDynamics$pmax.lm,
- pmax.rel.lm = sprintDynamics$pmax.rel.lm)
- write.csv2(exportData, file = paste(tempPath, "/sprintResults.csv", sep = ""), row.names = FALSE)
+ pmax.rel.lm = sprintDynamics$pmax.rel.lm))
+}
+exportSprintDynamicsWriteRow <- function(exportRow)
+{
+ write.csv2(exportRow, file = paste(tempPath, "/sprintResults.csv", sep = ""), row.names = FALSE)
}
#Finds the time correspondig to a given position in the formula x(t) = Vmax*(t + (1/K)*exp(-K*t)) -Vmax - 1/K
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]