Pārlūkot izejas kodu

Script files

master
Maxime Wack pirms 7 gadiem
vecāks
revīzija
a2a35b9fc0
5 mainītis faili ar 79 papildinājumiem un 0 dzēšanām
  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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

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


Notiek ielāde…
Atcelt
Saglabāt