瀏覽代碼

Script files

master
Maxime Wack 7 年之前
父節點
當前提交
a2a35b9fc0
共有 5 個文件被更改,包括 79 次插入0 次删除
  1. +9
    -0
      01_Import.R
  2. +14
    -0
      02_Tidy.R
  3. +13
    -0
      03_Transform.R
  4. +20
    -0
      04_Analyse.R
  5. +23
    -0
      Rmd/report.Rmd

+ 9
- 0
01_Import.R 查看文件

@@ -0,0 +1,9 @@
library(tidyverse)
#library(readxl)
#library(haven)
#library(rvest)
#library(sonlite)

# Import the raw data in csv ----
read_ ("Data/Raw/") %>%
write.csv("Data/.csv", row.names = F)

+ 14
- 0
02_Tidy.R 查看文件

@@ -0,0 +1,14 @@
library(tidyverse)
# library(lubridate)
# library(stringr)
# library(forcats)

# Load the csv data and tidy it ----
read_csv("Data/.csv") %>%
select() %>%
filter() %>%
mutate() %>%
dmap_if(is.character, factor) -> df

# Save the tidy-ed data ----
save(df, file = "tidy.Rdata")

+ 13
- 0
03_Transform.R 查看文件

@@ -0,0 +1,13 @@
library(tidyverse)
# library(lubridate)
# library(stringr)
# library(forcats)

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

df %>%


# Save the transformed data ----
save(df, "transformed.Rdata")

+ 20
- 0
04_Analyse.R 查看文件

@@ -0,0 +1,20 @@
library(tidyverse)
# library(broom)
# library(modelr)

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

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

# Specific transformations ----

# Models ----

# Tables ----

# Plots ----

# Save the results object ----
save(results, file = "results.Rdata")

+ 23
- 0
Rmd/report.Rmd 查看文件

@@ -0,0 +1,23 @@
---
title:
author:
date:
output:
_document:
---

```{r init, echo = F, message = F, warning = F}
library(tidyverse)
library(knitr)
#library(rmarkdown)
#library(pander)
#library(DT)

load("../results.Rdata")

opts_chunk$set(echo = F,
message = F,
warning = F,
error = F)
```


Loading…
取消
儲存