From 6962adcf23bae224d77539c40389a8d32058e10f Mon Sep 17 00:00:00 2001 From: "louis.heraut" <louis.heraut@inrae.fr> Date: Tue, 11 Jan 2022 20:04:35 +0100 Subject: [PATCH] Cleaned and commented --- plotting/map.R | 4 +++- plotting/matrix.R | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/plotting/map.R b/plotting/map.R index d622a30..3f9a3b9 100644 --- a/plotting/map.R +++ b/plotting/map.R @@ -192,7 +192,9 @@ map_panel = function (list_df2plot, df_meta, df_shapefile, idPer=1, outdirTmp='' # If there is the verbose option if (verbose) { # Prints the name of the map - print(paste('Map for variable :', type)) + print(paste('Map for variable : ', type, + " (", round(i/nbp*100, 1), " %)", + sep='')) } # If there is no specified station code to highlight (mini map) diff --git a/plotting/matrix.R b/plotting/matrix.R index ebf7805..8dba154 100644 --- a/plotting/matrix.R +++ b/plotting/matrix.R @@ -23,7 +23,7 @@ # # plotting/matrix.R # -# +# Allows the creation of a summarizing matrix of trend and break analyses ## 1. MATRIX PANEL @@ -401,10 +401,16 @@ matrix_panel = function (list_df2plot, df_meta, trend_period, mean_period, slice # Extracts each possibilities of first letter of station code firstLetter = levels(factor(substr(Code, 1, 1))) + # Number of different first letters + nfL = length(firstLetter) # For all the available first letter - for (fL in firstLetter) { + for (ifL in 1:nfL) { + # Gets the first letter + fL = firstLetter[ifL] # Print the matrix name - print(paste('Matrix for region :', fL)) + print(paste('Matrix for region : ', fL, + " (", round(ifL/nCode*100, 1), " %)", + sep='')) # Get only station code with the same first letter subCodefL = Code[substr(Code, 1, 1) == fL] -- GitLab