From 8d55eda07720470732a8c6edcee92e727fdf0039 Mon Sep 17 00:00:00 2001
From: unknown <olivier.delaigue@ANPI1430.antony.irstea.priv>
Date: Wed, 5 Apr 2017 15:24:24 +0200
Subject: [PATCH] v1.0.6.7 DataAltiExtrapolation_Valery code improved  (bug
 fixed) #4521

---
 DESCRIPTION                      | 2 +-
 R/DataAltiExtrapolation_Valery.R | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index a9ceaeef..85dc466a 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
 Package: airGR
 Type: Package
 Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
-Version: 1.0.6.6
+Version: 1.0.6.7
 Date: 2017-04-05
 Authors@R: c(
   person("Laurent", "Coron", role = c("aut", "trl")),
diff --git a/R/DataAltiExtrapolation_Valery.R b/R/DataAltiExtrapolation_Valery.R
index a3f05c96..f6629f2e 100644
--- a/R/DataAltiExtrapolation_Valery.R
+++ b/R/DataAltiExtrapolation_Valery.R
@@ -450,10 +450,10 @@ DataAltiExtrapolation_Valery <- function(DatesR,
         return(prcp)
       })
       if (PrecipScale) {
-        LayerPrecip_df <- LayerPrecip_df / rowMeans(LayerPrecip_df) * Precip
-        LayerPrecip_df[is.nan(LayerPrecip_df)] <- 0
+        LayerPrecip_mat <- LayerPrecip_df / rowMeans(LayerPrecip_df) * Precip
+        LayerPrecip_mat[is.nan(LayerPrecip_mat)] <- 0
       }
-      LayerPrecip <- as.list(LayerPrecip_df)
+      LayerPrecip <- as.list(as.data.frame(LayerPrecip_mat))
     }
   
   
-- 
GitLab