瀏覽代碼

Use RDS files for storage and put them in Data/

master
Maxime Wack 7 年之前
父節點
當前提交
e0d0a0215e
共有 3 個檔案被更改,包括 9 行新增12 行删除
  1. +2
    -3
      02_Tidy.R
  2. +3
    -5
      03_Transform.R
  3. +4
    -4
      04_Analyse.R

+ 2
- 3
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")

+ 3
- 5
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")

+ 4
- 4
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")

Loading…
取消
儲存