Skip to content

Commit 595754b

Browse files
committed
Gestion du bug ou les entetes sont absentes : on les force tout le temps en fixant une spec
1 parent 9ed102c commit 595754b

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

global.R

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ majAuto <- TRUE
1919
#Initialisation des variables persistantes a travers les sessions
2020
tableauLocal <- coordCarte <- coordSites <- coordGroupes <- choixGroupes <- selectionGroupes <- NULL
2121
dateMaj <- dateLocale <- dmy_hms("01/01/2022", truncated = 3)
22+
specColNames <- c("Status","Identifiant","Numéro de version","Nom","Filière","Date de début",
23+
"Date de fin","Type","Cause","Information complémentaire", "Puissance maximale (MW)",
24+
"Puissance disponible (MW)", "Date de publication")
25+
specColTypes = "ccdccTTcccddT"
2226

2327
if(file.exists("instaplan.dateMaj.rda")) {
2428
load("instaplan.dateMaj.rda")
@@ -408,11 +412,12 @@ carte <- function(t, xduree = duree, xdebut = debut, xfin = fin,
408412
}
409413

410414
#debug
411-
#tableau <- read_delim(fichier, skip = 1, delim=";", locale=locale(encoding='latin1', decimal_mark=",")) %>% preparation()
412-
#tableauFiltre <- historique(tableau) %>% filtrage()
413-
#tableauTrie <- tri(tableauFiltre)
414-
#graphique(tableauTrie)
415-
#tableauProjete <- projection(tableauFiltre)
416-
#empilement(tableauProjete)
417-
#tableauGeo <- geolocalisation(tableauFiltre)
418-
#carte(tableauGeo)
415+
# tableau <- read_delim(fichier, skip = 2, delim=";", locale=locale(encoding='latin1', decimal_mark="."),
416+
# col_names = specColNames, col_types = specColTypes) %>% preparation()
417+
# tableauFiltre <- historique(tableau) %>% filtrage()
418+
# tableauTrie <- tri(tableauFiltre)
419+
# graphique(tableauTrie)
420+
# tableauProjete <- projection(tableauFiltre)
421+
# empilement(tableauProjete)
422+
# tableauGeo <- geolocalisation(tableauFiltre)
423+
# carte(tableauGeo)

server.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ server <- function(input, output, session) {
4848

4949
if(!is.null(fichierInput_R())) {
5050
#Import et traitement du fichier EDF
51-
tableau <- read_delim(fichierInput_R(), skip = 1, delim=";",
52-
locale=locale(encoding='latin1', decimal_mark=",")) %>%
53-
preparation()
51+
tableau <- read_delim(fichierInput_R(), skip = 2, delim=";", locale=locale(encoding='latin1', decimal_mark="."),
52+
col_names = specColNames, col_types = specColTypes) %>% preparation()
5453

5554
# Mettre a jour base si fichier charge plus recent et enrichir avec historique
5655
dateFichier <- date_R()

0 commit comments

Comments
 (0)