diff --git a/plotting/layout.R b/plotting/layout.R index a7ab458f0d985218d58ea3fd740d15be94ef43c1..b2b8d361fdb671f6d1c10878a871e09983f77b2d 100644 --- a/plotting/layout.R +++ b/plotting/layout.R @@ -14,7 +14,7 @@ library(RColorBrewer) source('plotting/panel.R', encoding='latin1') -panels_layout = function (df_data, df_meta, layout_matrix, figdir='', filedir_opt='', filename_opt='', variable='', df_trend=NULL, p_threshold=0.1, unit2day=365.25, type='', period=NULL, missRect=FALSE, time_header=NULL, info_header=TRUE, header_ratio=2) { +panels_layout = function (df_data, df_meta, layout_matrix, figdir='', filedir_opt='', filename_opt='', variable='', df_trend=NULL, p_threshold=0.1, unit2day=365.25, type='', period=NULL, missRect=FALSE, time_header=NULL, info_header=TRUE, time_ratio=2, var_ratio=3) { if (all(class(df_data) != 'list')) { df_data = list(df_data) @@ -175,12 +175,20 @@ panels_layout = function (df_data, df_meta, layout_matrix, figdir='', filedir_op LMrow = nrow(layout_matrix_H) for (i in 1:(LMrow+nbh)) { - if (i <= nbh) { + if (info_header & i == 1) { LM = rbind(LM, rep(i, times=LMcol)) + } else if (!is.null(time_header) & i == 2) { + LM = rbind(LM, + matrix(rep(rep(i, times=LMcol), + times=time_ratio), + ncol=LMcol, byrow=TRUE)) + # if (i <= nbh) { + # LM = rbind(LM, rep(i, times=LMcol)) + } else { LM = rbind(LM, matrix(rep(layout_matrix_H[i-nbh,], - times=header_ratio), + times=var_ratio), ncol=LMcol, byrow=TRUE)) }} diff --git a/plotting/panel.R b/plotting/panel.R index 835d9a7769f6852a04961cc79c852309c6537f72..9a9ce89f0a07f9c31069a815c3d56a2b5a42e5b1 100644 --- a/plotting/panel.R +++ b/plotting/panel.R @@ -10,7 +10,7 @@ library(ggh4x) library(RColorBrewer) -time_panel = function (df_data_code, df_trend_code, type, p_threshold=0.1, missRect=FALSE, unit2day=365.25, period=NULL, last=FALSE, color=NULL) { +time_panel = function (df_data_code, df_trend_code, type, p_threshold=0.1, missRect=FALSE, unit2day=365.25, period=NULL, last=FALSE, color=NULL, norm=FALSE) { if (type == 'sqrt(Q)') { @@ -18,42 +18,48 @@ time_panel = function (df_data_code, df_trend_code, type, p_threshold=0.1, missR } maxQ = max(df_data_code$Qm3s, na.rm=TRUE) - - power = get_power(maxQ) - - dbrk = 10^power + power = get_power(maxQ) + + if (norm) { + dbrk = 10^power + } else { + dbrk = 1 + } df_data_code$Qm3sN = df_data_code$Qm3s / dbrk if (!is.null(df_trend_code)) { - df_trend_code$trendN = df_trend_code$trend / dbrk df_trend_code$interceptN = df_trend_code$intercept / dbrk } - - maxQN = max(df_data_code$Qm3sN, na.rm=TRUE) - if (maxQN >= 5) { + maxQN = max(df_data_code$Qm3sN, na.rm=TRUE) + + maxQtmp = maxQ/10^power + if (maxQtmp >= 5) { dbrk = 1.0 accuracy = 0.1 - } else if (maxQN < 5 & maxQN >= 3) { + } else if (maxQtmp < 5 & maxQtmp >= 3) { dbrk = 0.5 accuracy = 0.1 - } else if (maxQN < 3 & maxQN >= 2) { + } else if (maxQtmp < 3 & maxQtmp >= 2) { dbrk = 0.4 accuracy = 0.1 - } else if (maxQN < 2 & maxQN >= 1) { + } else if (maxQtmp < 2 & maxQtmp >= 1) { dbrk = 0.2 accuracy = 0.1 - } else if (maxQN < 1) { + } else if (maxQtmp < 1) { dbrk = 0.1 accuracy = 0.1 } + if (!norm) { + dbrk = dbrk * 10^power + accuracy = NULL + } + dDate = as.numeric(df_data_code$Date[length(df_data_code$Date)] - df_data_code$Date[1]) / unit2day - - # datebreak = round(as.numeric(dDate) / unit2day / 11 , 0) if (dDate >= 100) { datebreak = 25 @@ -72,12 +78,18 @@ time_panel = function (df_data_code, df_trend_code, type, p_threshold=0.1, missR theme(panel.background=element_rect(fill='white'), text=element_text(family='sans'), - panel.border=element_blank(), - panel.grid.major.y=element_line(color='grey85', size=0.3), + # panel.border=element_blank(), + panel.border = element_rect(color="grey85", + fill=NA, + size=0.7), + + # panel.grid.major.y=element_line(color='grey85', size=0.3), + panel.grid.major.y=element_line(color='grey85', size=0.15), panel.grid.major.x=element_blank(), - axis.ticks.y=element_blank(), + # axis.ticks.y=element_blank(), + axis.ticks.y=element_line(color='grey75', size=0.3), axis.ticks.x=element_line(color='grey75', size=0.3), axis.text.x=element_text(color='grey40'), @@ -86,7 +98,7 @@ time_panel = function (df_data_code, df_trend_code, type, p_threshold=0.1, missR ggh4x.axis.ticks.length.minor=rel(0.5), axis.ticks.length=unit(1.5, 'mm'), - plot.title=element_text(size=9, vjust=-3, + plot.title=element_text(size=9, vjust=-2, hjust=-1E-3, color='grey20'), axis.title.x=element_blank(), axis.title.y=element_blank(), @@ -111,8 +123,6 @@ time_panel = function (df_data_code, df_trend_code, type, p_threshold=0.1, missR size=0.3) } else { p = p + - # geom_line(aes(x=df_data_code$Date, y=df_data_code$Qm3sN), - # color='grey70') + geom_point(aes(x=df_data_code$Date, y=df_data_code$Qm3sN), shape=1, color='grey20', size=1) } @@ -169,27 +179,42 @@ time_panel = function (df_data_code, df_trend_code, type, p_threshold=0.1, missR color='cornflowerblue') } - p = p + - ggtitle(bquote(.(type)~~'['*m^{3}*'.'*s^{-1}*'] x'~10^{.(as.character(power))}~~~'tendance :'~.(format(df_trend_code$trend, scientific=TRUE, digits=3))~m^{3}*'.'*s^{-1}*'.'*an^{-1})) + if (norm) { + p = p + + ggtitle(bquote(bold(.(type))~~'['*m^{3}*'.'*s^{-1}*'] x'~10^{.(as.character(power))}~~~bold('tendance')~.(format(df_trend_code$trend, scientific=TRUE, digits=3))~'['*m^{3}*'.'*s^{-1}*'.'*an^{-1}*']')) + } else { + p = p + + ggtitle(bquote(bold(.(type))~~'['*m^{3}*'.'*s^{-1}*']'~~~bold('tendance')~.(format(df_trend_code$trend, scientific=TRUE, digits=3))~'['*m^{3}*'.'*s^{-1}*'.'*an^{-1}*']')) + } } else { - p = p + - ggtitle(bquote(.(type)~' ['*m^{3}*'.'*s^{-1}*'] x'~10^{.(as.character(power))})) + if (norm) { + p = p + + ggtitle(bquote(bold(.(type))~~'['*m^{3}*'.'*s^{-1}*'] x'~10^{.(as.character(power))}~~~bold('tendance')~.(format(df_trend_code$trend, scientific=TRUE, digits=3))~'['*m^{3}*'.'*s^{-1}*'.'*an^{-1}*']')) + } else { + p = p + + ggtitle(bquote(bold(.(type))~~'['*m^{3}*'.'*s^{-1}*']'~~~bold('tendance')~.(format(df_trend_code$trend, scientific=TRUE, digits=3))~'['*m^{3}*'.'*s^{-1}*'.'*an^{-1}*']')) + } } } else { - p = p + - ggtitle(bquote(.(type)~' ['*m^{3}*'.'*s^{-1}*'] x'~10^{.(as.character(power))})) + if (norm) { + p = p + + ggtitle(bquote(bold(.(type))~' ['*m^{3}*'.'*s^{-1}*'] x'~10^{.(as.character(power))})) + } else { + p = p + + ggtitle(bquote(bold(.(type))~' ['*m^{3}*'.'*s^{-1}*']')) + } } - # if (norm) { - # p = p + - # ylab(bquote('débit ['*m^{3}*'.'*s^{-1}*'] x'~10^{.(as.character(power))})) - # } else { - # p = p + - # ylab(expression(paste('débit [', m^{3}, '.', - # s^{-1}, ']', sep=''))) - # } + if (norm) { + p = p + + ylab(bquote('débit ['*m^{3}*'.'*s^{-1}*'] x'~10^{.(as.character(power))})) + } else { + p = p + + ylab(expression(paste('débit [', m^{3}, '.', + s^{-1}, ']', sep=''))) + } p = p + # xlab('date') + @@ -201,8 +226,9 @@ time_panel = function (df_data_code, df_trend_code, type, p_threshold=0.1, missR date_labels="%Y", limits=c(min(df_data_code$Date), max(df_data_code$Date)), - expand=c(0, 0)) + - + expand=c(0, 0)) + + p = p + scale_y_continuous(breaks=seq(0, maxQN*10, dbrk), limits=c(0, maxQN*1.1), expand=c(0, 0), @@ -215,26 +241,82 @@ time_panel = function (df_data_code, df_trend_code, type, p_threshold=0.1, missR text_panel = function(code, df_meta) { df_meta_code = df_meta[df_meta$code == code,] - text = paste( - "<span style='font-size:18pt'> station <b>", code, "</b></span><br>", - "nom : ", df_meta_code$nom, "<br>", - "région hydrographique : ", df_meta_code$region_hydro, "<br>", - "position : (", df_meta_code$L93X, "; ", df_meta_code$L93Y, ")", "<br>", - "surface : ", df_meta_code$surface_km2, " km<sup>2</sup>", + text1 = paste( + "<b>", code, '</b> - ', df_meta_code$nom, "<br>", + sep='') + + text2 = paste( + "<b>", + "Région hydro : ", df_meta_code$region_hydro, "<br>", + "</b>", + sep='') + + text3 = paste( + "<b>", + "Superficie : ", df_meta_code$surface_km2, " [km<sup>2</sup>] <br>", + "X = ", df_meta_code$L93X, " [m ; Lambert 93]", + "</b>", + sep='') + + text4 = paste( + "<b>", + "Altitude : ", df_meta_code$altitude_m, " [m]<br>", + "Y = ", df_meta_code$L93Y, " [m ; Lambert 93]", + "</b>", + sep='') + + text5 = paste( + "<b>", + "(Banque Hydro)<br>", + "(Banque Hydro)", + "</b>", sep='') - gtext = richtext_grob(text, - x=0, y=1, - margin=unit(c(5, 5, 5, 5), "mm"), - hjust=0, vjust=1, - gp=gpar(col="grey20", fontsize=12)) - return(gtext) + gtext1 = richtext_grob(text1, + x=0, y=1, + margin=unit(c(t=5, r=5, b=0, l=5), "mm"), + hjust=0, vjust=1, + gp=gpar(col="#00A3A8", fontsize=14)) + + gtext2 = richtext_grob(text2, + x=0, y=0.6, + margin=unit(c(t=0, r=5, b=0, l=5), "mm"), + hjust=0, vjust=1, + gp=gpar(col="grey20", fontsize=9)) + + gtext3 = richtext_grob(text3, + x=0, y=1, + margin=unit(c(t=0, r=5, b=5, l=5), "mm"), + hjust=0, vjust=1, + gp=gpar(col="grey20", fontsize=9)) + + gtext4 = richtext_grob(text4, + x=0, y=1, + margin=unit(c(t=0, r=5, b=5, l=5), "mm"), + hjust=0, vjust=1, + gp=gpar(col="grey20", fontsize=9)) + + gtext5 = richtext_grob(text5, + x=0, y=1, + margin=unit(c(t=0, r=5, b=5, l=5), "mm"), + hjust=0, vjust=1, + gp=gpar(col="grey20", fontsize=9)) + + gtext_merge = grid.arrange(grobs=list(gtext1, gtext2, gtext3, + gtext4, gtext5), + layout_matrix=matrix(c(1, 1, 1, + 2, 2, 2, + 3, 4, 5), + nrow=3, + byrow=TRUE)) + + return(gtext_merge) } matrice_panel = function (list_df2plot, df_meta) { - + nbp = length(list_df2plot) minTrend = c() @@ -304,6 +386,8 @@ matrice_panel = function (list_df2plot, df_meta) { X = as.integer(factor(as.character(Type_mat))) Y = as.integer(factor(Code_mat)) + + options(repr.plot.width=X, repr.plot.height=Y) mat = ggplot() + @@ -335,11 +419,6 @@ matrice_panel = function (list_df2plot, df_meta) { plot.margin=margin(5, 5, 5, 5, unit="mm"), ) - - - # geom_point(aes(x=X, y=Y), - # shape=21, fill=Fill_mat, color=Color_mat, - # size=15, stroke=1) + for (i in 1:length(X)) { mat = mat + @@ -350,20 +429,14 @@ matrice_panel = function (list_df2plot, df_meta) { mat = mat + coord_fixed() + - - scale_x_continuous(limits=c(min(c(X, Y)) - rel(1.5), - max(c(X, Y)) + rel(0.5)), + + scale_x_continuous(limits=c(min(X) - rel(1.5), + max(X) + rel(0.5)), expand=c(0, 0)) + - scale_y_continuous(limits=c(min(c(X, Y)) - rel(0.5), - max(c(X, Y)) + rel(1)), + scale_y_continuous(limits=c(min(Y) - rel(0.5), + max(Y) + rel(1)), expand=c(0, 0)) - - # scale_x_continuous(limits=c(min(X)-0.4, max(X)+0.2), - # expand=c(0, 0)) + - - # scale_y_continuous(limits=c(min(Y)-0.2, max(Y)+0.4), - # expand=c(0, 0)) for (i in 1:length(Code)) { mat = mat + @@ -382,7 +455,6 @@ matrice_panel = function (list_df2plot, df_meta) { size=3.5, color='grey40') } - for (i in 1:length(Trend_mat)) { trend = Trend_mat[i] if (!is.na(trend)) { diff --git a/processing/analyse.R b/processing/analyse.R index e83f5bdb5e1336dbd7148d768d143ba0c8fac946..83d7c1aec14eab7f63b0df660d5f579fdaecbf43 100644 --- a/processing/analyse.R +++ b/processing/analyse.R @@ -87,71 +87,89 @@ get_intercept = function (df_Xtrend, df_Xlist, unit2day=365.25) { get_QAtrend = function (df_data, period) { # AVERAGE ANNUAL FLOW : QA # - ### /!\ verify order conservation ### - df_QAlist = prepare(df_data, colnamegroup=c('code')) - - df_QAEx = extract.Var(data.station=df_QAlist, - funct=mean, - timestep='year', - period=period, - pos.datetime=1, - na.rm=TRUE) + + period = as.list(period) + + Imax = 0 + df_QAtrendB = tibble() + + for (per in period){ + + df_QAlist = prepare(df_data, colnamegroup=c('code')) + + df_QAEx = extract.Var(data.station=df_QAlist, + funct=mean, + timestep='year', + period=per, + pos.datetime=1, + na.rm=TRUE) + + df_QAtrend = Estimate.stats(data.extract=df_QAEx) + + I = interval(per[1], per[2]) + if (I > Imax) { + Imax = I + df_QAlistB = df_QAlist + df_QAExB = df_QAEx + } + + df_QAtrend = bind_cols(df_QAtrend, + tibble(period_start=as.Date(per[1])), + tibble(period_end=as.Date(per[2]))) + df_QAtrendB = bind_rows(df_QAtrendB, df_QAtrend) - df_QAtrend = Estimate.stats(data.extract=df_QAEx) + } - res_QAtrend = clean(df_QAtrend, df_QAEx, df_QAlist) + res_QAtrend = clean(df_QAtrendB, df_QAExB, df_QAlistB) return (res_QAtrend) } get_QMNAtrend = function (df_data, period) { # MONTHLY MINIMUM FLOW IN THE YEAR : QMNA # - df_QMNAlist = prepare(df_data, colnamegroup=c('code')) - - ### /!\ PLUS RAPIDE ### - # fMNA = function (X) { - # # prendre un paquet de 1 ans et faire la moyenne par mois et retourner le minimum des debit - # dpm = length(X)/12 - # # print(dpm) - # # print(length(X)) - # monthmean = c() - # for (i in 1:12) { - # id = round(dpm*(i-1)+1, 0) - # iu = round(i*dpm, 0) - # monthmean = append(monthmean, mean(X[id:iu], na.rm=TRUE)) - # # print(paste('start', id)) - # # print(paste('end', iu)) - # # print('') - # } - # # print(monthmean) - # return (min(monthmean, na.rm=TRUE)) - # } - # df_QMNAEx = extract.Var(data.station=df_QMNAlist, - # funct=fMNA, - # period=period, - # pos.datetime=1)#, - # na.rm=TRUE) ### /!\ PAS COMPRIS ### - - df_QMNAEx = extract.Var(data.station=df_QMNAlist, - funct=mean, - period=period, - timestep='month', - pos.datetime=1, - na.rm=TRUE) - - ### /!\ NOM DE COLONNE PAS CONSERVER ### - df_QMNAlist = reprepare(df_QMNAEx, df_QMNAlist, colnamegroup=c('code')) - - df_QMNAEx = extract.Var(data.station=df_QMNAlist, - funct=min, - period=period, - timestep='year', - pos.datetime=1, - na.rm=TRUE) - - df_QMNAtrend = Estimate.stats(data.extract=df_QMNAEx) - - res_QMNAtrend = clean(df_QMNAtrend, df_QMNAEx, df_QMNAlist) + + period = as.list(period) + + Imax = 0 + df_QMNAtrendB = tibble() + + for (per in period) { + + df_QMNAlist = prepare(df_data, colnamegroup=c('code')) + + df_QMNAEx = extract.Var(data.station=df_QMNAlist, + funct=mean, + period=per, + timestep='month', + pos.datetime=1, + na.rm=TRUE) + + df_QMNAlist = reprepare(df_QMNAEx, df_QMNAlist, colnamegroup=c('code')) + + df_QMNAEx = extract.Var(data.station=df_QMNAlist, + funct=min, + period=per, + timestep='year', + pos.datetime=1, + na.rm=TRUE) + + df_QMNAtrend = Estimate.stats(data.extract=df_QMNAEx) + + I = interval(per[1], per[2]) + if (I > Imax) { + Imax = I + df_QMNAlistB = df_QMNAlist + df_QMNAExB = df_QMNAEx + } + + df_QMNAtrend = bind_cols(df_QMNAtrend, + tibble(period_start=as.Date(per[1])), + tibble(period_end=as.Date(per[2]))) + df_QMNAtrendB = bind_rows(df_QMNAtrendB, df_QMNAtrend) + } + + + res_QMNAtrend = clean(df_QMNAtrendB, df_QMNAExB, df_QMNAlistB) return (res_QMNAtrend) } @@ -162,7 +180,7 @@ get_VCN10trend = function (df_data, df_meta, period) { # Get all different stations code Code = levels(factor(df_meta$code)) - + df_data_roll = tibble() for (c in Code) { @@ -177,21 +195,40 @@ get_VCN10trend = function (df_data, df_meta, period) { code=c) df_data_roll = bind_rows(df_data_roll, df_data_code) - } - df_VCN10list = prepare(df_data_roll, colnamegroup=c('code')) - - df_VCN10Ex = extract.Var(data.station=df_VCN10list, - funct=min, - period=period, - timestep='year', - pos.datetime=1, - na.rm=TRUE) - - df_VCN10trend = Estimate.stats(data.extract=df_VCN10Ex) + period = as.list(period) + + Imax = 0 + df_VCN10trendB = tibble() + + for (per in period) { + + df_VCN10list = prepare(df_data_roll, colnamegroup=c('code')) + + df_VCN10Ex = extract.Var(data.station=df_VCN10list, + funct=min, + period=per, + timestep='year', + pos.datetime=1, + na.rm=TRUE) + + df_VCN10trend = Estimate.stats(data.extract=df_VCN10Ex) + + I = interval(per[1], per[2]) + if (I > Imax) { + Imax = I + df_VCN10listB = df_VCN10list + df_VCN10ExB = df_VCN10Ex + } + + df_VCN10trend = bind_cols(df_VCN10trend, + tibble(period_start=as.Date(per[1])), + tibble(period_end=as.Date(per[2]))) + df_VCN10trendB = bind_rows(df_VCN10trendB, df_VCN10trend) + } - res_VCN10trend = clean(df_VCN10trend, df_VCN10Ex, df_VCN10list) + res_VCN10trend = clean(df_VCN10trendB, df_VCN10ExB, df_VCN10listB) return (res_VCN10trend) } diff --git a/processing/format.R b/processing/format.R index b5b79b02511ba1af06652c0768782b86d1bcc448..7ac9101f8a02e2a06568e414e20a3252d0bc2f04 100644 --- a/processing/format.R +++ b/processing/format.R @@ -83,10 +83,10 @@ reprepare = function(df_XEx, df_Xlist, colnamegroup=NULL) { clean = function (df_Xtrend, df_XEx, df_Xlist) { - # print(str(df_XEx)) - df_Xlist = reprepare(df_XEx, df_Xlist, colnamegroup=c('code')) + # print(df_Xlist) + df_Xlist$data$code = NA for (g in df_Xlist$info$group) { df_Xlist$data$code[which(df_Xlist$data$group == g)] = df_Xlist$info$code[df_Xlist$info$group == g] diff --git a/script.R b/script.R index 56575dc1ccedfb7c5953ea64dee6dc4b402b1dc1..c34e2d92ddfcc3828ace843cc8d4984b68d14672 100644 --- a/script.R +++ b/script.R @@ -22,13 +22,13 @@ BHfiledir = ## Manual selection ## # Name of the file that will be analysed from the BH directory BHfilename = - "" - # c("S2235610_HYDRO_QJM.txt", - # "P1712910_HYDRO_QJM.txt", - # "P0885010_HYDRO_QJM.txt", - # "A1000030_HYDRO_QJM.txt", - # "A2250310_HYDRO_QJM.txt" - # ) + # "" + c("S2235610_HYDRO_QJM.txt", + "P1712910_HYDRO_QJM.txt", + "P0885010_HYDRO_QJM.txt", + "A1000030_HYDRO_QJM.txt", + "A2250310_HYDRO_QJM.txt" + ) ## Or list selection ## # Path to the list file of BH data that will be analysed @@ -36,20 +36,20 @@ BHlistdir = "" BHlistname = - # "" - "Liste-station_RRSE.docx" + "" + # "Liste-station_RRSE.docx" ### NIVALE ### # Path to the directory where NV data is stored NVfiledir = - # "" - "France207" + "" + # "France207" # Name of the file that will be analysed from the NV directory NVfilename = - # "" - "all" + "" + # "all" # Path to the list file of metadata about station that will be analysed @@ -57,14 +57,14 @@ NVlistdir = "" NVlistname = - # "" - "liste_bv_principaux_global.txt" + "" + # "liste_bv_principaux_global.txt" ### TREND ANALYSIS ### # Time period to analyse -period = c("1980-01-01","2019-12-31") - +period_all = c("1700-01-01", "2020-12-31") +period2 = c("1968-01-01", "2020-12-31") ######################## @@ -120,11 +120,6 @@ if (BHlistname != ""){ } -###### -BHfilename = BHfilename[1:10] -###### - - # Extract metadata about selected stations df_meta_BH = extractBH_meta(computer_data_path, BHfiledir, BHfilename) @@ -153,13 +148,13 @@ df_meta = df_join$meta # QA TREND # -res_QAtrend = get_QAtrend(df_data, period) +# res_QAtrend = get_QAtrend(df_data, period=list(period_all, period2)) # QMNA TREND # -res_QMNAtrend = get_QMNAtrend(df_data, period) +res_QMNAtrend = get_QMNAtrend(df_data, period=list(period_all, period2)) # VCN10 TREND # -res_VCN10trend = get_VCN10trend(df_data, df_meta, period) +# res_VCN10trend = get_VCN10trend(df_data, period=list(period_all, period2)) # TIME PANEL # @@ -171,41 +166,43 @@ res_VCN10trend = get_VCN10trend(df_data, df_meta, period) # type=list('Q', 'sqrt(Q)'), # info_header=TRUE, # time_header=NULL, -# header_ratio=3, +# var_ratio=3, # figdir=figdir, # filename_opt='time') -panels_layout(list(res_QAtrend$data, res_QMNAtrend$data, - res_VCN10trend$data), - layout_matrix=c(1, 2, 3), - df_meta=df_meta, - df_trend=list(res_QAtrend$trend, res_QMNAtrend$trend, - res_VCN10trend$trend), - type=list(bquote(Q[A]), bquote(Q[MNA]), bquote(V[CN10])), - missRect=list(TRUE, TRUE, TRUE), - period=period, - info_header=TRUE, - time_header=df_data, - header_ratio=2, - figdir=figdir, - filename_opt='') - - -# panels_layout(list(res_QAtrend$data, res_VCN10trend$data), -# layout_matrix=c(1, 2), +# panels_layout(list(res_QAtrend$data, res_QMNAtrend$data, +# res_VCN10trend$data), +# layout_matrix=c(1, 2, 3), # df_meta=df_meta, -# df_trend=list(res_QAtrend$trend, +# df_trend=list(res_QAtrend$trend, res_QMNAtrend$trend, # res_VCN10trend$trend), -# type=list(bquote(Q[A]), bquote(V[CN10])), -# missRect=list(TRUE, TRUE), -# period=period, +# type=list(bquote(Q[A]), bquote(Q[MNA]), bquote(V[CN10])), +# missRect=list(TRUE, TRUE, TRUE), +# period=period_all, # info_header=TRUE, # time_header=df_data, -# header_ratio=2, +# time_ratio=2, +# var_ratio=3, # figdir=figdir, # filename_opt='') +panels_layout(list(res_QAtrend$data, res_VCN10trend$data), + layout_matrix=c(1, 2), + df_meta=df_meta, + df_trend=list(res_QAtrend$trend, + res_VCN10trend$trend), + type=list(bquote(Q[A]), bquote(V[CN10])), + missRect=list(TRUE, TRUE), + period=period_all, + info_header=TRUE, + time_header=df_data, + time_ratio=2, + var_ratio=5, + figdir=figdir, + filename_opt='') + + ### /!\ Removed 185 row(s) containing missing values (geom_path) -> remove NA ###