Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
small fix to benchmarking code
authorLuka Stanisic <luka.stanisic@imag.fr>
Thu, 20 Mar 2014 08:43:44 +0000 (09:43 +0100)
committerLuka Stanisic <luka.stanisic@imag.fr>
Thu, 20 Mar 2014 08:43:44 +0000 (09:43 +0100)
contrib/benchmarking_code_block/Rhist.R

index 884d3ae..991060e 100644 (file)
@@ -65,15 +65,19 @@ for(i in unique(NAME))
   if (length(vector1)==1)
     {
       #If there is only one element
+      h<-hist(vector1) # Just for R compatibility reasons
       h$breaks<-c(vector1,vector1)
       h$counts<-1
     }
   else
     {
       if (type=="mean")
-        #Mean value only
-        h$breaks<-c(mean(vector1),mean(vector1))
-        h$counts<-length(vector1)
+        {
+          #Mean value only
+          h<-hist(vector1) # Just for R compatibility reasons
+          h$breaks<-c(mean(vector1),mean(vector1))
+          h$counts<-length(vector1)
+        }
       else
         if (type=="default")
           #Standard HISTOGRAM: