Commit 33a077ec authored by Heraut Louis's avatar Heraut Louis
Browse files

new analyse for sht

parent 45950f41
No related merge requests found
Showing with 31 additions and 0 deletions
+31 -0
...@@ -141,6 +141,36 @@ iRegHydro = c('D'='Affluents du Rhin', ...@@ -141,6 +141,36 @@ iRegHydro = c('D'='Affluents du Rhin',
## 2. SELECTION ______________________________________________________ ## 2. SELECTION ______________________________________________________
### 2.0. Copy a selection of station _________________________________
copy_selection = function (select_dir, select_file, from_dir, to_dir,
codeCol='code', sep=',', quote='"',
optname='_HYDRO_QJM') {
if (!(file.exists(to_dir))) {
dir.create(to_dir, recursive=TRUE)
}
select_path = file.path(select_dir, select_file)
# Extracts the data as a data frame
Code = read.table(select_path,
header=TRUE,
encoding='UTF-8',
sep=sep,
quote=quote)[codeCol]
# Stores it in the tibble of selection
Code = as.character(Code[[1]])
file_list = paste0(Code, optname, '.txt')
path_list = file.path(from_dir, file_list)
file.copy(path_list, to_dir)
}
# copy_selection(
# computer_data_path, 'RRSE_METROPOLE.csv',
# '/home/louis/Documents/bouleau/INRAE/CDD_stationnarite/data/BanqueHydro_Export2021/',
# file.path(computer_data_path, 'RRSE'),
# codeCol='Num')
# missing : K0010010, H78335XX, K7414010, H21220XX
### 2.1. Creation of a selection _____________________________________ ### 2.1. Creation of a selection _____________________________________
#' @title Create a '.txt' selection of station #' @title Create a '.txt' selection of station
#' @description Create a txt file that resume all the station data #' @description Create a txt file that resume all the station data
......
...@@ -71,6 +71,7 @@ computer_work_path = ...@@ -71,6 +71,7 @@ computer_work_path =
filedir = filedir =
# "" # ""
"AEAG_selection" "AEAG_selection"
# "RRSE"
# Name of the files that will be analysed from the data directory # Name of the files that will be analysed from the data directory
# (if "all", all the file of the directory will be chosen) # (if "all", all the file of the directory will be chosen)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment