From e0d0a0215e502db824b1d7fb3bcf0aa09c58669d Mon Sep 17 00:00:00 2001 From: Maxime Wack Date: Thu, 2 Mar 2017 09:42:01 -0500 Subject: [PATCH] Use RDS files for storage and put them in Data/ --- 02_Tidy.R | 5 ++--- 03_Transform.R | 8 +++----- 04_Analyse.R | 8 ++++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/02_Tidy.R b/02_Tidy.R index dfc20f9..c8e8e11 100644 --- a/02_Tidy.R +++ b/02_Tidy.R @@ -8,7 +8,6 @@ read_csv("Data/.csv") %>% select() %>% filter() %>% mutate() %>% - dmap_if(is.character, factor) -> df - + dmap_if(is.character, factor) %>% # Save the tidy-ed data ---- -save(df, file = "tidy.Rdata") + saveRDS(file = "Data/tidy.rds") diff --git a/03_Transform.R b/03_Transform.R index 54cfe8d..8503e0f 100644 --- a/03_Transform.R +++ b/03_Transform.R @@ -4,10 +4,8 @@ library(tidyverse) # library(forcats) # Load the tidy-ed data ---- -load("tidy.Rdata") - -df %>% - +readRDS("Data/tidy.rds") %>% +# Transform the data # Save the transformed data ---- -save(df, "transformed.Rdata") +saveRDS("Data/transformed.rds") diff --git a/04_Analyse.R b/04_Analyse.R index 699f2a3..b779a70 100644 --- a/04_Analyse.R +++ b/04_Analyse.R @@ -2,12 +2,12 @@ library(tidyverse) # library(broom) # library(modelr) -# Load the transformed data ---- -load("transformed.Rdata") - # Initialize an empty list to store the results ---- results <- list() +# Load the transformed data ---- +readRDS("Data/transformed.rds") -> df + # Specific transformations ---- # Models ---- @@ -17,4 +17,4 @@ results <- list() # Plots ---- # Save the results object ---- -save(results, file = "results.Rdata") +saveRDS(results, file = "Data/results.rds")