@@ -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") |
@@ -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") |
@@ -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") |