From f6388f9f0ca02d9d0f666980e72941ece75b1c52 Mon Sep 17 00:00:00 2001 From: Maxime Wack Date: Sun, 12 Mar 2017 22:52:53 +0100 Subject: [PATCH] =?UTF-8?q?Types=20s=C3=BBrs=20pour=20la=20lecture=20de=20?= =?UTF-8?q?GHM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.R b/app.R index f085db5..3d7188a 100644 --- a/app.R +++ b/app.R @@ -9,12 +9,13 @@ library(stringr) library(lubridate) # Lecture fichier de GHM ---- -read_csv("ghm.csv", col_types = cols(IPP = col_character())) %>% +read_csv("ghm.csv", col_types = cols(.default = col_character())) %>% `names<-`(c("IPP", "IEP", "Age", "Sexe", "Codepos", "GHM", "date_entree", "date_sortie")) %>% mutate(date_entree = date_entree %>% as.Date(format = "%Y/%m/%d"), date_sortie = date_sortie %>% as.Date(format = "%Y/%m/%d"), DS = as.numeric(date_sortie - date_entree), - Sexe = Sexe %>% factor(labels = c("Homme", "Femme"))) -> GHM + Age = as.numeric(Age), + Sexe = Sexe %>% factor(levels = c("1", "2"), labels = c("Homme", "Femme"))) -> GHM # Lecture labels racines de GHM et garder celles existantes ---- read_csv("racinesGHM.csv") %>%