[chronojump] Fixed crash on paintCrossVariables laterality with 1 unique x



commit 79a8fd283e171db682a0888146fac6ea2d702697
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon May 2 12:39:19 2016 +0200

    Fixed crash on paintCrossVariables laterality with 1 unique x

 encoder/graph.R |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 5708159..8ae136c 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -1527,11 +1527,11 @@ paintCrossVariablesLaterality <- function(x, y, laterality, colBalls)
 
        if(length(unique(laterality)) > 1) 
        {
-               if(length(laterality[laterality == "R"]) >= 3)
+               if(length(laterality[laterality == "R"]) >= 3 && length(unique(x[laterality == "R"])) > 1)
                        fitLine(x[laterality=="R"],y[laterality=="R"], "black", 1, 2)
-               if(length(laterality[laterality == "L"]) >= 3)
+               if(length(laterality[laterality == "L"]) >= 3 && length(unique(x[laterality == "L"])) > 1)
                        fitLine(x[laterality=="L"],y[laterality=="L"], "black", 1, 3)
-               if(length(laterality[laterality == "RL"]) >= 3)
+               if(length(laterality[laterality == "RL"]) >= 3 && length(unique(x[laterality == "RL"])) > 1)
                        fitLine(x[laterality=="RL"],y[laterality=="RL"], "black", 1, 4)
        }
 }


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