diff --git a/DESCRIPTION b/DESCRIPTION
new file mode 100644
index 0000000000000000000000000000000000000000..3f6c0457258f1c7c07fce0f5062ae69f7b589c09
--- /dev/null
+++ b/DESCRIPTION
@@ -0,0 +1,24 @@
+Package: ash
+Version: 1.0
+Date: 2021-11-01
+Title: Analyse de Stationnarité Hydrologique
+Authors@R: c(
+	   person(given="Louis",
+	          family="Héraut",
+	          email="louis.heraut@inrae.fr"),
+           person(given="Éric",
+	          family="Sauquet",
+	          email="eric.sauquet@inrae.fr")
+	   )	   
+Description: Ash is a toolbox of R code that perfoms a stationarity
+	     analysis of the low water regime which in french is
+	     'analyse de stationnarité du régime des étiages'. In this
+	     configuration, this analysis is centered on the
+	     Adour-Garonne hydrological basin which is located in the
+	     south-west part of France.
+Depends: R (>= 3.5.0)
+License: License: GPL-3 + file LICENSE
+Encoding: UTF-8
+RoxygenNote: 7.1.2
+Roxygen: list(markdown=TRUE)
+
diff --git a/README.txt b/README
similarity index 90%
rename from README.txt
rename to README
index 8c7ff12bf3afd3b13b1b865e4b0b39ffe8f4d25c..9ac09e484b6807ab96d4f5d34dc8c9a6cbfc727e 100644
--- a/README.txt
+++ b/README
@@ -24,13 +24,15 @@ README
 	2. Then if you fill confident you can directly jump to part 3.
 	Otherwise, open the 'script_install.R' file. This file guide
 	you throught the different package you need to install to make
-	this toolbox functionnal. You can run this entire code.
+	this toolbox functionnal. You can run this entire code
+	(RStudio : Ctrl+Alt+R).
 
 	3. Open the 'main.R' file. This script is your script of
 	interaction with the rest of the code. You have to put here
 	your settings and execute the entire file when you are ready.
-	It is possible that some packages will be missing. Take the
-	time to install them before re-execute the 'main.R' file.
+	(RStudio : Ctrl+Alt+R) It is possible that some packages will
+	be missing. Take the time to install them before re-execute
+	the 'main.R' file.
 
 	4. Figures will be stored in the 'figures' repository and
 	results in the 'results' repository. All the rest of the code
diff --git a/R_script/processing/analyse.R b/R_script/processing/analyse.R
index 7870c4367ec3d3969d6085c1aa4f50330cb6eaab..b891d39f5d4001f1a64726028390550985a6a11e 100644
--- a/R_script/processing/analyse.R
+++ b/R_script/processing/analyse.R
@@ -104,6 +104,9 @@ get_intercept = function (df_Xtrend, df_Xlist, unit2day=365.25) {
 # hydrological variable
 get_XAtrend = function (df_data, df_meta, period, per.start, alpha, dayLac_lim, yearNA_lim, funct=mean, df_flag=NULL, df_mod=tibble(), ...) {
 
+    print(paste('Computes XA trend with : ',
+                as.character(substitute(funct)), sep=''))
+    
     if (!is.null(df_flag)) {
         # Local corrections if needed
         res = flag_data(df_data, df_meta,
@@ -177,6 +180,8 @@ get_XAtrend = function (df_data, df_meta, period, per.start, alpha, dayLac_lim,
 # year (QMNA) hydrological variable
 get_QMNAtrend = function (df_data, df_meta, period, alpha, sampleSpan, dayLac_lim, yearNA_lim, df_flag, df_mod=tibble()) {
 
+    print('Computes QMNA trend')
+    
     # Local corrections if needed
     res = flag_data(df_data, df_meta,
                     df_flag=df_flag,
@@ -294,6 +299,8 @@ rollmean_code = function (df_data, Code, nroll=10, df_mod=NULL) {
 # Realises the trend analysis of the minimum 10 day average flow
 # over the year (VCN10) hydrological variable
 get_VCN10trend = function (df_data, df_meta, period, alpha, sampleSpan, dayLac_lim, yearNA_lim, df_flag, df_mod=tibble()) {
+
+    print('Computes VCN10 trend')
     
     # Get all different stations code
     Code = levels(factor(df_meta$code))
@@ -410,6 +417,8 @@ which_underfirst = function (L, UpLim, select_longest=TRUE) {
 
 get_tDEBtrend = function (df_data, df_meta, period, alpha, sampleSpan, dayLac_lim, yearNA_lim, df_flag, thresold_type='VCN10', select_longest=TRUE, df_mod=tibble()) {
 
+    print('Computes tDEB trend')
+    
     # Get all different stations code
     Code = levels(factor(df_meta$code))
     # Gets the number of station
@@ -572,6 +581,8 @@ get_tDEBtrend = function (df_data, df_meta, period, alpha, sampleSpan, dayLac_li
 # Realises the trend analysis of the date of the minimum 10 day
 # average flow over the year (VCN10) hydrological variable
 get_tCENtrend = function (df_data, df_meta, period, alpha, sampleSpan, dayLac_lim, yearNA_lim, df_flag, df_mod=tibble()) {
+
+    print('Computes tCEN trend')
     
     # Get all different stations code
     Code = levels(factor(df_meta$code))
diff --git a/R_script/processing/extract.R b/R_script/processing/extract.R
index f692c631d1c2d1df89de655233e7ff01a1b850f5..92519d17b4c194ab0e90bb2e30aaa176c84089d7 100644
--- a/R_script/processing/extract.R
+++ b/R_script/processing/extract.R
@@ -142,9 +142,22 @@ iRegHydro = c('D'='Affluents du Rhin',
 
 ## 2. SELECTION ______________________________________________________
 ### 2.1. Creation of a selection _____________________________________
-# Create a txt file that resume all the station data files present
-# in a filedir
-create_selection = function (computer_data_path, filedir, outname, optname='_HYDRO_QJM') {
+#' @title Create a '.txt' selection of station
+#' @description Create a txt file that resume all the station data
+#' files present in a filedir
+#' @param computer_data_path Path to the data.
+#' @param filedir Directory of Banque HYDRO data you want to use in
+#' ash\\computer_data_path\\ to get station codes. If "" is
+#' use, data will be search in ash\\computer_data_path\\.
+#' @param outname Name of the created selection file.
+#' @param optname Optional name that will be added to the selected
+#' station codes to match names of the Banque HYDRO files
+#' (default: '_HYDRO_QJM').
+#' @return Writes a selection '.txt' file of data filename of
+#' stations.
+#' @export
+create_selection = function (computer_data_path, filedir, outname,
+                             optname='_HYDRO_QJM') {
 
     # Out file for store results
     outfile = file.path(computer_data_path, outname)
@@ -183,8 +196,15 @@ create_selection = function (computer_data_path, filedir, outname, optname='_HYD
 #     "selection.txt")
 
 ### 2.2. TXT selection _____________________________________________
-# Gets the selection of station from the selection txt file generated
-# by the 'create_selection' function
+#' @title Get selection of a '.txt' file
+#' @description Gets the selection of station from the selection txt
+#' file generated by the 'create_selection' function
+#' @param computer_data_path Path to the data.
+#' @param listdir Directory of the selection '.txt' file in
+#' ash\\computer_data_path\\.
+#' @param listname Name of the selection '.txt' file.
+#' @return A vector of string containing file names of stations.
+#' @export
 get_selection_TXT = function (computer_data_path, listdir, listname) {
     
     # Gets the file path to the data
@@ -205,7 +225,25 @@ get_selection_TXT = function (computer_data_path, listdir, listname) {
     # "selection.txt")
 
 ### 2.3. Agence de l'eau Adour-Garonne selection _____________________
-# Gets the selection of station from the 'Liste-station_RRSE.docx' file
+#' @title Get selection of a '.docx' file
+#' @description Gets the selection of station from a formated '.docx'
+#' file.
+#' @param computer_data_path Path to the data.
+#' @param listdir Directory of the selection '.docx' file in
+#' ash\\computer_data_path\\.
+#' @param listname Name of the selection '.docx' file.
+#' @param code_nameCol Name of the column of the file containing code
+#' stations
+#' @param choice_nameCol Name of the column of the file containing the
+#' choice if the associated station is selected or not. If set to
+#' 'NULL', all stations in the 'code_nameCol' are selected.
+#' @param choice_Val Vector of string meaning that the station is
+#' selected.
+#' @param optname Optional name that will be added to the selected
+#' station codes to match names of the Banque HYDRO files
+#' (default: '_HYDRO_QJM').
+#' @return A vector of string containing file names of stations.
+#' @export
 get_selection_DOCX = function (computer_data_path, listdir, listname,
                                code_nameCol='code',
                                choice_nameCol='Choix',
@@ -256,8 +294,20 @@ get_selection_DOCX = function (computer_data_path, listdir, listname,
 
 
 ## 3. EXTRACTION _____________________________________________________
-### 3.1. Extraction of metadata
-# Extraction of metadata of stations
+### 3.1. Extraction of metadata ______________________________________
+#' @title Extract metadata
+#' @description Extraction of metadata of stations.
+#' @param computer_data_path Path to the data.
+#' @param filedir Directory of Banque HYDRO data you want to use in
+#' ash\\computer_data_path\\ to get station codes. If "" is
+#' use, data will be search in ash\\computer_data_path\\.
+#' @param filename String or vector of string of all filenames from
+#' which metadata will be extracted. If set to 'all', all the file in
+#' 'fildir' will be use.
+#' @param verbose Boolean to indicate if more processing info are
+#' printed (default : TRUE).
+#' @return A tibble containing metadata about selected stations.
+#' @export
 extract_meta = function (computer_data_path, filedir, filename,
                          verbose=TRUE) {
     
@@ -401,7 +451,19 @@ extract_meta = function (computer_data_path, filedir, filename,
 #     c('H5920011_HYDRO_QJM.txt', 'K4470010_HYDRO_QJM.txt'))
 
 ### 3.2. Extraction of data __________________________________________
-# Extraction of data
+#' @title Extract data
+#' @description Extraction of data of stations.
+#' @param computer_data_path Path to the data.
+#' @param filedir Directory of Banque HYDRO data you want to use in
+#' ash\\computer_data_path\\ to get station codes. If "" is
+#' use, data will be search in ash\\computer_data_path\\.
+#' @param filename String or vector of string of all filenames from
+#' which data will be extracted. If set to 'all', all the file in
+#' 'fildir' will be use.
+#' @param verbose Boolean to indicate if more processing info are
+#' printed (default : TRUE).
+#' @return A tibble containing data about selected stations.
+#' @export
 extract_data = function (computer_data_path, filedir, filename,
                          verbose=TRUE) {
     
@@ -496,8 +558,19 @@ extract_data = function (computer_data_path, filedir, filename,
 #     '',
 #     c('H5920011_HYDRO_QJM.txt', 'K4470010_HYDRO_QJM.txt'))
 
-
-### 3.3. Extraction of climate data and metadata
+### 3.3. Extraction of climate data and metadata _____________________
+#' @title Extract climate data
+#' @description Extraction of climate data and metadata
+#' @param computer_data_path Path to the data.
+#' @param filedir Directory of data you want to use in
+#' ash\\computer_data_path\\ to get climate data. If "" is
+#' use, data will be search in ash\\computer_data_path\\.
+#' @param colNames String or vector of string of column names of the
+#' tibble that will be created.
+#' @param verbose Boolean to indicate if more processing info are
+#' printed (default : TRUE).
+#' @return A tibble containing data about selected stations.
+#' @export
 extract_climate_data = function (computer_data_path, filedir,
                                 colNames=c('Date', 'PRCP_mm',
                                            'PET_mm', 'T_degC'),
@@ -536,8 +609,28 @@ extract_climate_data = function (computer_data_path, filedir,
 
 
 ## 4. SHAPEFILE MANAGEMENT ___________________________________________
-# Generates a list of shapefiles to draw a hydrological map of
-# the France
+#' @title Shapefiles loading
+#' @description  Generates a list of shapefiles to draw a hydrological
+#' map of the France
+#' @param resources_path Path to the resources directory.
+#' @param fr_shpdir Directory you want to use in ash\\resources_path\\
+#' to get the France shapefile.
+#' @param fr_shpname Name of the France shapefile.
+#' @param bs_shpdir Directory you want to use in ash\\resources_path\\
+#' to get the hydrological basin shapefile.
+#' @param bs_shpname Name of the hydrological basin shapefile.
+#' @param sbs_shpdir Directory you want to use in
+#' ash\\resources_path\\ to get the hydrological sub-basin shapefile.
+#' @param sbs_shpname Name of the hydrological sub-basin shapefile.
+#' @param rv_shpdir Directory you want to use in ash\\resources_path\\
+#' to get the hydrological network shapefile.
+#' @param rv_shpname  Name of the hydrological network shapefile.
+#' @param show_river Boolean to indicate if the shapefile of the
+#' hydrological network will be charge because it is a heavy one and
+#' that it slows down the entire process (default : TRUE)
+#' @return A list of shapefiles converted as tibbles that can be plot
+#' with 'geom_polygon' or 'geom_path'.
+#' @export
 ini_shapefile = function (resources_path, fr_shpdir, fr_shpname, bs_shpdir, bs_shpname, sbs_shpdir, sbs_shpname, rv_shpdir, rv_shpname, show_river=TRUE) {
 
     # Path for shapefile
@@ -570,7 +663,6 @@ ini_shapefile = function (resources_path, fr_shpdir, fr_shpname, bs_shpdir, bs_s
     } else {
         df_river = NULL   
     }
-    return (list(france=df_france, bassin=df_bassin, subbassin=df_subbassin, river=df_river))
+    return (list(france=df_france, bassin=df_bassin,
+                 subbassin=df_subbassin, river=df_river))
 }
-
-
diff --git a/R_script/processing/script_extract.R b/R_script/processing/script_extract.R
index 06875f606b80ccd120a94c48b3178e0bf9f414ce..425b3f1e80beeaac23616149b21c0c09ae2949b6 100644
--- a/R_script/processing/script_extract.R
+++ b/R_script/processing/script_extract.R
@@ -33,9 +33,12 @@
 
 
 # Sourcing R files
-source(file.path('R_script', 'processing', 'extract.R'), encoding='UTF-8')
-source(file.path('R_script', 'processing', 'format.R'), encoding='UTF-8')
-
+source(file.path('R_script', 'processing', 'extract.R'),
+       encoding='UTF-8')
+source(file.path('R_script', 'processing', 'format.R'),
+       encoding='UTF-8')
+source(file.path('R_script', 'processing', 'analyse.R'),
+       encoding='UTF-8')
 
 ## 1. EXTRACTION OF HYDROMETRIC STATIONS _____________________________
 if ('station_extraction' %in% to_do) {
diff --git a/main.R b/main.R
index e44a7661ffd9229f24a11899068157f9d3a62f8f..5434d116066ece3110123c607e621130e5aaa607 100644
--- a/main.R
+++ b/main.R
@@ -29,8 +29,8 @@
 # main.R
 #
 # Main script that regroups all command lines needed to interact with
-# this toolbox. Choose your parameters before execute all the script
-# or line by line.
+# this toolbox. Choose your parameters before executing all the script
+# (RStudio : Ctrl+Alt+R) or line by line.
 
 
 #  ___         __                         _    _                
@@ -59,14 +59,15 @@
 ## You can modify this part without risk ##      |___/ 
 
 ## 1. WORKING DIRECTORY ______________________________________________
-# Work path (it normally needs to end with '\\ASH' directory)
+# Work path (it normally needs to end with '\\ash' directory)
 computer_work_path = 
-    "/home/louis/Documents/bouleau/INRAE/CDD_stationnarite/ASH"
-    # "C:\\Users\\louis.heraut\\Documents\\CDD_stationnarite\\ASH"
+    "/home/louis/Documents/bouleau/INRAE/CDD_stationnarite/ash"
+    # "C:\\Users\\louis.heraut\\Documents\\CDD_stationnarite\\ash"
 
 ## 2. DATA DIRECTORY _________________________________________________
-# Directory of data you want to use in ASH\\data\\ to extract stations
-# flow data. If "" is use, data will be search in ASH\\data\\.
+# Directory of Banque HYDRO data you want to use in ash\\data\\ to
+# extract stations flow data. If "" is use, data will be search in
+# ash\\data\\.
 filedir =
     # ""
     "AEAG_selection"
@@ -135,6 +136,9 @@ modify_advanced_settings = FALSE
 # Sets working directory
 setwd(computer_work_path)
 
+# Usefull library
+library(roxygen2)
+
 # Creates list of period for analyses
 trend_period = list(periodAll, periodSub)
 mean_period = list(periodRef, periodCur)
diff --git a/script_install.R b/script_install.R
new file mode 100644
index 0000000000000000000000000000000000000000..dc72c799aeed642617d2590957a2ecb8ccdfe96f
--- /dev/null
+++ b/script_install.R
@@ -0,0 +1,101 @@
+# \\\
+# Copyright 2021-2022 Louis Héraut*1,
+#                     Éric Sauquet*2,
+#                     Valentin Mansanarez
+#
+# *1   INRAE, France
+#      louis.heraut@inrae.fr
+# *2   INRAE, France
+#      eric.sauquet@inrae.fr
+#
+# This file is part of ash R toolbox.
+#
+# Ash R toolbox is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# Ash R toolbox is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with ash R toolbox.
+# If not, see <https://www.gnu.org/licenses/>.
+# ///
+#
+#
+# script_install.R
+#
+# Script that regroups all command lines potentially needed to make
+# functional this toolbox.
+
+
+#  _   _                  ___              __  _       
+# | | | | ___ ___  _ _   / __| ___  _ _   / _|(_) __ _ 
+# | |_| |(_-</ -_)| '_| | (__ / _ \| ' \ |  _|| |/ _` |
+#  \___/ /__/\___||_|    \___|\___/|_||_||_|  |_|\__, | ______________
+## You can modify this part without risk ##      |___/ 
+# Choose your OS before execute all the script or line by line. This
+# toolbox is not tested for OSX user (but normally windows
+# installation should be ok) ...
+OS =
+    # 'windows'
+    'linux'
+
+
+#  ___               ___              __  _       
+# |   \  ___ __ __  / __| ___  _ _   / _|(_) __ _ 
+# | |) |/ -_)\ V / | (__ / _ \| ' \ |  _|| |/ _` |
+# |___/ \___| \_/   \___|\___/|_||_||_|  |_|\__, | ___________________
+## /!\ Do not touch if you are not aware ## |___/
+
+## 1. OS COMMON INSTALLATION PACKAGES ________________________________
+### 1.1. On CRAN _____________________________________________________
+install.packages("tools")
+install.packages("devtools")
+install.packages("dplyr")
+install.packages("officer")
+install.packages("lubridate")
+install.packages('zoo')
+install.packages("gridtext")
+install.packages("lubridate")
+install.packages('trend')
+install.packages("Hmisc")
+install.packages("ggplot2")
+install.packages('scales')
+install.packages('ggh4x')
+install.packages("RColorBrewer")
+install.packages("png")
+install.packages("shadowtext")
+install.packages("qpdf")
+install.packages("gridExtra")
+install.packages("grid")
+install.packages("roxygen2")
+
+
+### 1.2. On git ______________________________________________________
+library(devtools)
+print("")
+print('For the following packages you need to press the right key in order to install all.')
+print("")
+install_github("https://github.com/benRenard/BFunk") 
+install_git("https://gitlab.irstea.fr/valentin.mansanarez/statistical-analysis-of-trends.git")
+
+
+## 2. OS NOT COMMON INSTALLATION PACKAGES ____________________________
+if (OS == 'linux') {
+    print('You firstly need to install manually some other packages with :')
+    print('sudo apt-get -y update && sudo apt-get install -y  libudunits2-dev libgdal-dev libgeos-dev libproj-dev')
+    print('and')
+    print('sudo apt-get install gdal-bin proj-bin libgdal-dev libproj-dev')
+    
+    if (askYesNo('... is it ok ?')) {
+        install.packages("sf")
+        install.packages("rgdal")
+    }
+} else {
+    install.packages("sf")
+    install.packages("rgdal")
+}