From 30e55fea16888c60c09623b1cc448f85fa158877 Mon Sep 17 00:00:00 2001 From: jtlandis Date: Wed, 19 Jun 2024 15:25:17 -0400 Subject: [PATCH] changing file paths and configuring local data reads with `here()` --- _quarto.yml | 6 +++--- examples/example-avida.qmd | 8 +++++--- examples/example-ebola.qmd | 4 +++- examples/example-temperatures.qmd | 4 +++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/_quarto.yml b/_quarto.yml index 6bc84f4..9a020e2 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -76,9 +76,9 @@ book: - "class7.qmd" - part: "class8.qmd" chapters: - - deprecates/scripts/04_projects/project-day-2-files/example-analyses/example-temperatures.qmd - - deprecates/scripts/04_projects/project-day-2-files/example-analyses/example-ebola.qmd - - deprecates/scripts/04_projects/project-day-2-files/example-analyses/example-avida.qmd + - examples/example-temperatures.qmd + - examples/example-ebola.qmd + - examples/example-avida.qmd diff --git a/examples/example-avida.qmd b/examples/example-avida.qmd index d78aade..7f22c9a 100644 --- a/examples/example-avida.qmd +++ b/examples/example-avida.qmd @@ -7,9 +7,11 @@ format: ```{r setup, echo=FALSE, include=FALSE} library(tidyverse) -wt <- read.csv("../datasets/avida/avida_wildtype.csv", header = TRUE, sep = ",") -mut <- read.csv("../datasets/avida/avida_mutant.csv", header = TRUE, sep = ",") -comp <- read.csv("../datasets/avida/avida_competition.csv", header = TRUE, sep = ",") +library(here) +data_path <- "data/project-day-2-files/datasets/avida" +wt <- read.csv(here(data_path, "avida_wildtype.csv"), header = TRUE, sep = ",") +mut <- read.csv(here(data_path, "avida_mutant.csv"), header = TRUE, sep = ",") +comp <- read.csv(here(data_path, "avida_competition.csv"), header = TRUE, sep = ",") ``` # Preamble diff --git a/examples/example-ebola.qmd b/examples/example-ebola.qmd index ac4b46e..ff7eee8 100644 --- a/examples/example-ebola.qmd +++ b/examples/example-ebola.qmd @@ -7,7 +7,9 @@ format: ```{r setup, echo=FALSE, include=FALSE} library(tidyverse) -ebola <- read.csv("../datasets/ebola.csv", header = TRUE, sep = ",") +library(here) +data_path <- "data/project-day-2-files/datasets" +ebola <- read.csv(here(data_path, "ebola.csv"), header = TRUE, sep = ",") ``` # Preamble diff --git a/examples/example-temperatures.qmd b/examples/example-temperatures.qmd index 085d6ef..d690bc4 100644 --- a/examples/example-temperatures.qmd +++ b/examples/example-temperatures.qmd @@ -7,7 +7,9 @@ format: ```{r setup, echo=FALSE, include=FALSE} library(tidyverse) -temps <- read.csv("../datasets/temperatures.csv", header = TRUE, sep = ",") +library(here) +data_path <- "data/project-day-2-files/datasets" +temps <- read.csv(here(data_path, "temperatures.csv"), header = TRUE, sep = ",") ``` # Preamble