From 4e4b6041fa03bfe73c62b888881903eb8c4d7ead Mon Sep 17 00:00:00 2001
From: "louis.heraut" <louis.heraut@inrae.fr>
Date: Tue, 1 Feb 2022 01:44:12 +0100
Subject: [PATCH] minor

---
 plotting/datasheet.R | 12 ++++++------
 plotting/layout.R    |  4 ++--
 script.R             | 12 ++++++------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/plotting/datasheet.R b/plotting/datasheet.R
index 74d11a2..e2c2b79 100644
--- a/plotting/datasheet.R
+++ b/plotting/datasheet.R
@@ -34,7 +34,7 @@ source('processing/analyse.R', encoding='UTF-8')
 # Manages datasheets creations for all stations. Makes the call to
 # the different headers, trend analysis graphs and realises arranging
 # every plots.
-datasheet_panel = function (list_df2plot, df_meta, trend_period, info_header, time_header, foot_note, layout_matrix, info_ratio, time_ratio, var_ratio, foot_height, resource_path, AEAGlogo_file, INRAElogo_file, FRlogo_file, outdirTmp) {
+datasheet_panel = function (list_df2plot, df_meta, trend_period, info_header, time_header, foot_note, layout_matrix, info_ratio, time_ratio, var_ratio, foot_height, resources_path, AEAGlogo_file, INRAElogo_file, FRlogo_file, outdirTmp) {
 
     # The percentage of augmentation and diminution of the min
     # and max limits for y axis
@@ -432,7 +432,7 @@ datasheet_panel = function (list_df2plot, df_meta, trend_period, info_header, ti
             P[[i+nbh]] = p 
         }
 
-        Foot = foot_panel(k, nCode, resource_path,
+        Foot = foot_panel(k, nCode, resources_path,
                           AEAGlogo_file, INRAElogo_file,
                           FRlogo_file, foot_height)
 
@@ -1580,7 +1580,7 @@ hydrograph_panel = function (df_data_code, period, margin=NULL) {
 }
 
 
-foot_panel = function (n_page, N_page, resource_path, AEAGlogo_file, INRAElogo_file, FRlogo_file, foot_height) {
+foot_panel = function (n_page, N_page, resources_path, AEAGlogo_file, INRAElogo_file, FRlogo_file, foot_height) {
     
     text_page = paste(
         "fiche station <b>p. ", n_page, "/", N_page, "</b>",
@@ -1603,9 +1603,9 @@ foot_panel = function (n_page, N_page, resource_path, AEAGlogo_file, INRAElogo_f
                                hjust=1, vjust=0.5,
                                gp=gpar(col="#00A3A8", fontsize=6))
     
-    AEAGlogo_path = file.path(resource_path, AEAGlogo_file)
-    INRAElogo_path = file.path(resource_path, INRAElogo_file)
-    FRlogo_path = file.path(resource_path, FRlogo_file)
+    AEAGlogo_path = file.path(resources_path, AEAGlogo_file)
+    INRAElogo_path = file.path(resources_path, INRAElogo_file)
+    FRlogo_path = file.path(resources_path, FRlogo_file)
 
     AEAGlogo_img = readPNG(AEAGlogo_path)
     AEAGlogo_grob = rasterGrob(AEAGlogo_img,
diff --git a/plotting/layout.R b/plotting/layout.R
index 91fd5cf..458f2f7 100644
--- a/plotting/layout.R
+++ b/plotting/layout.R
@@ -145,7 +145,7 @@ datasheet_layout = function (df_data, df_meta, layout_matrix,
                              info_ratio=1, time_ratio=2,
                              var_ratio=3, foot_height=0.5,
                              df_shapefile=NULL,
-                             resource_path=NULL,
+                             resources_path=NULL,
                              AEAGlogo_file=NULL,
                              INRAElogo_file=NULL,
                              FRlogo_file=NULL) {
@@ -245,7 +245,7 @@ datasheet_layout = function (df_data, df_meta, layout_matrix,
     # If datasheets needs to be plot
     if ('datasheet' %in% toplot) {
         
-        datasheet_panel(list_df2plot, df_meta, trend_period, info_header=info_header, time_header=time_header, foot_note=foot_note, layout_matrix=layout_matrix, info_ratio=info_ratio, time_ratio=time_ratio, var_ratio=var_ratio, foot_height=foot_height, resource_path=resource_path, AEAGlogo_file=AEAGlogo_file, INRAElogo_file=INRAElogo_file, FRlogo_file=FRlogo_file, outdirTmp=outdirTmp)
+        datasheet_panel(list_df2plot, df_meta, trend_period, info_header=info_header, time_header=time_header, foot_note=foot_note, layout_matrix=layout_matrix, info_ratio=info_ratio, time_ratio=time_ratio, var_ratio=var_ratio, foot_height=foot_height, resources_path=resources_path, AEAGlogo_file=AEAGlogo_file, INRAElogo_file=INRAElogo_file, FRlogo_file=FRlogo_file, outdirTmp=outdirTmp)
 
     }
 
diff --git a/script.R b/script.R
index 2292f48..83a1108 100644
--- a/script.R
+++ b/script.R
@@ -154,12 +154,12 @@ if (!(file.exists(figdir))) {
 }
 print(paste('figdir :', figdir))
 
-# Resource directory
-resource_path = file.path(computer_work_path, 'resource')
-if (!(file.exists(resource_path))) {
-  dir.create(resource_path)
+# Resources directory
+resources_path = file.path(computer_work_path, 'resources')
+if (!(file.exists(resources_path))) {
+  dir.create(resources_path)
 }
-print(paste('resource_path :', resource_path))
+print(paste('resources_path :', resources_path))
 
 # Logo filename
 AEAGlogo_file = 'agence-de-leau-adour-garonne_logo.png'
@@ -351,7 +351,7 @@ datasheet_layout(toplot=c(
                  df_shapefile=df_shapefile,
                  figdir=figdir,
                  filename_opt='',
-                 resource_path=resource_path,
+                 resources_path=resources_path,
                  AEAGlogo_file=AEAGlogo_file,
                  INRAElogo_file=INRAElogo_file,
                  FRlogo_file=FRlogo_file)
-- 
GitLab