[chronojump] Fixed Pmax graph (meanSpeed and meanForce came as strings)



commit 1e2b8120e2bcc1108e5ebbae74057e711e5495a4
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Jan 17 11:14:08 2018 +0100

    Fixed Pmax graph (meanSpeed and meanForce came as strings)

 encoder/graph.R               |    4 +++-
 encoder/pfvProfileEvolution.R |    6 +-----
 2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 71c6c0f..27a36bf 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -3580,7 +3580,9 @@ doProcess <- function(options)
        #Pmax(F0,V0) will use pafCurves
         if(op$Analysis == "cross" && op$AnalysisVariables[1] == "Pmax(F0,V0)")
        {
-               pfvProfileExecute(pafCurves)
+               pmaxArray = data.frame(pafCurves$series, as.numeric(pafCurves$meanSpeed), 
as.numeric(pafCurves$meanForce))
+               colnames(pmaxArray) = c("date", "meanSpeed", "meanForce")
+               pfvProfileExecute(pmaxArray)
        }
         
         if(op$Analysis=="1RMIndirect") {
diff --git a/encoder/pfvProfileEvolution.R b/encoder/pfvProfileEvolution.R
index 0148e1c..0c915d4 100644
--- a/encoder/pfvProfileEvolution.R
+++ b/encoder/pfvProfileEvolution.R
@@ -122,11 +122,6 @@ pfvProfileDrawProfilesEvolution <- function(analyzeTable)
 
 pfvProfileExecute <- function(analyzeTable)
 {
-       #colnames(analyzeTable)[2] = "date"
-       #if reading from "/tmp/chronojump-last-encoder-analyze-table.txt", "series" is the second column, but
-       #using pafCurves "series" is the first column
-       colnames(analyzeTable)[which(colnames(analyzeTable)=="series")] = "date"
-
        print("analyzeTable[2,]")
        print(analyzeTable[2,])
 
@@ -136,6 +131,7 @@ pfvProfileExecute <- function(analyzeTable)
 pfvProfileReadFile <- function(inputFile)
 {
         analyzeTable = read.csv(inputFile, dec = ".", sep = ",")
+       colnames(analyzeTable)[which(colnames(analyzeTable)=="series")] = "date"
         return(analyzeTable)
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]