Browse Source

Use RDS files for storage and put them in Data/

master
Maxime Wack 7 years ago
parent
commit
e0d0a0215e
3 changed files with 9 additions and 12 deletions
  1. +2
    -3
      02_Tidy.R
  2. +3
    -5
      03_Transform.R
  3. +4
    -4
      04_Analyse.R

+ 2
- 3
02_Tidy.R View File

@@ -8,7 +8,6 @@ read_csv("Data/.csv") %>%
select() %>% select() %>%
filter() %>% filter() %>%
mutate() %>% mutate() %>%
dmap_if(is.character, factor) -> df

dmap_if(is.character, factor) %>%
# Save the tidy-ed data ---- # Save the tidy-ed data ----
save(df, file = "tidy.Rdata")
saveRDS(file = "Data/tidy.rds")

+ 3
- 5
03_Transform.R View File

@@ -4,10 +4,8 @@ library(tidyverse)
# library(forcats) # library(forcats)


# Load the tidy-ed data ---- # Load the tidy-ed data ----
load("tidy.Rdata")

df %>%

readRDS("Data/tidy.rds") %>%
# Transform the data


# Save the transformed data ---- # Save the transformed data ----
save(df, "transformed.Rdata")
saveRDS("Data/transformed.rds")

+ 4
- 4
04_Analyse.R View File

@@ -2,12 +2,12 @@ library(tidyverse)
# library(broom) # library(broom)
# library(modelr) # library(modelr)


# Load the transformed data ----
load("transformed.Rdata")

# Initialize an empty list to store the results ---- # Initialize an empty list to store the results ----
results <- list() results <- list()


# Load the transformed data ----
readRDS("Data/transformed.rds") -> df

# Specific transformations ---- # Specific transformations ----


# Models ---- # Models ----
@@ -17,4 +17,4 @@ results <- list()
# Plots ---- # Plots ----


# Save the results object ---- # Save the results object ----
save(results, file = "results.Rdata")
saveRDS(results, file = "Data/results.rds")

Loading…
Cancel
Save