Pārlūkot izejas kodu

Use RDS files for storage and put them in Data/

master
Maxime Wack pirms 7 gadiem
vecāks
revīzija
e0d0a0215e
3 mainītis faili ar 9 papildinājumiem un 12 dzēšanām
  1. +2
    -3
      02_Tidy.R
  2. +3
    -5
      03_Transform.R
  3. +4
    -4
      04_Analyse.R

+ 2
- 3
02_Tidy.R Parādīt failu

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

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

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

Notiek ielāde…
Atcelt
Saglabāt