diff --git a/plotting/datasheet.R b/plotting/datasheet.R index 74d11a2e9cba1c35b35f4990f848be31b78724bf..e2c2b797f0182df63a6529c92eecf392f54beea4 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 91fd5cfd58a362f74c2c3393cf22d14dcfc038b7..458f2f791858de357f438b9fa6de61a3d8a6740f 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 2292f482ca28887a9ff2d1c3cfadc3b1837f2757..83a1108624253c2c2d84b87f8e6030de2c96b0f9 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)