Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new data read #144

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions episodes/data/ebola_cases_2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
year,month,day,confirm
2014,5,18,1
2014,5,20,2
2014,5,21,4
2014,5,22,6
2014,5,23,1
2014,5,24,2
2014,5,26,10
2014,5,27,8
2014,5,28,2
2014,5,29,12
2014,5,30,7
2014,5,31,2
2014,6,1,5
2014,6,2,2
2014,6,3,1
2014,6,5,3
2014,6,6,7
2014,6,7,4
2014,6,8,6
2014,6,9,1
2014,6,10,29
2014,6,11,1
2014,6,12,10
2014,6,13,20
2014,6,14,17
2014,6,15,4
2014,6,16,1
2014,6,17,4
2014,6,18,8
2014,6,19,11
2014,6,20,9
2014,6,21,3
2014,6,22,3
2014,6,23,2
2014,6,24,9
2014,6,25,9
2014,6,26,14
2014,6,27,15
2014,6,28,21
2014,6,29,9
2014,6,30,15
2014,7,1,12
2014,7,2,11
2014,7,3,4
2014,7,4,11
2014,7,5,17
2014,7,6,9
2014,7,7,18
2014,7,8,11
2014,7,9,8
2014,7,10,14
2014,7,11,8
2014,7,12,7
2014,7,13,4
2014,7,14,7
2014,7,15,5
2014,7,16,7
2014,7,17,8
2014,7,18,10
2014,7,19,13
2014,7,20,13
2014,7,21,18
2014,7,22,9
2014,7,23,13
2014,7,24,10
2014,7,25,40
2014,7,26,8
2014,7,27,7
2014,7,28,14
2014,7,29,9
2014,7,30,14
2014,7,31,12
2014,8,1,12
2014,8,2,15
2014,8,3,14
2014,8,4,5
2014,8,5,13
2014,8,6,8
2014,8,7,8
2014,8,8,13
2014,8,9,8
2014,8,10,13
2014,8,11,4
2014,8,12,9
2014,8,13,6
2014,8,14,8
2014,8,15,5
2014,8,16,1
2014,8,17,5
2014,8,18,17
2014,8,19,18
2014,8,20,35
2014,8,21,18
2014,8,22,16
2014,8,23,18
2014,8,24,38
2014,8,25,25
2014,8,26,42
2014,8,27,16
2014,8,28,26
2014,8,29,30
2014,8,30,23
2014,8,31,24
2014,9,1,29
2014,9,2,29
2014,9,3,43
2014,9,4,41
2014,9,5,15
2014,9,6,44
2014,9,7,30
2014,9,8,42
2014,9,9,38
2014,9,10,21
2014,9,11,39
2014,9,12,37
2014,9,13,38
2014,9,14,49
2014,9,15,68
2014,9,16,84
2014,9,17,56
10 changes: 5 additions & 5 deletions episodes/read-cases.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ This help us remember package functions and avoid namespace conflicts.

- Create an RStudio project. If needed, follow this [how-to guide on "Hello RStudio Projects"](https://docs.posit.co/ide/user/ide/get-started/#hello-rstudio-projects) to create one.
- Inside the RStudio project, create the `data/` folder.
- Inside the `data/` folder, save the [ebola_cases.csv](https://epiverse-trace.github.io/tutorials-early/data/ebola_cases.csv) and [marburg.zip](https://epiverse-trace.github.io/tutorials-early/data/Marburg.zip) files.
- Inside the `data/` folder, save the [ebola_cases_2.csv](https://epiverse-trace.github.io/tutorials-early/data/ebola_cases_2.csv) and [marburg.zip](https://epiverse-trace.github.io/tutorials-early/data/Marburg.zip) files.

::::::::::

Expand All @@ -72,9 +72,9 @@ The below example shows how to import a `csv` file into `R` environment using `{

```{r,eval=FALSE,echo=TRUE}
# read data
# e.g., the path to our file is data/raw-data/ebola_cases.csv then:
# e.g., the path to our file is data/raw-data/ebola_cases_2.csv then:
ebola_confirmed <- rio::import(
here::here("data", "ebola_cases.csv")
here::here("data", "ebola_cases_2.csv")
) %>%
dplyr::as_tibble() # for a simple data frame output

Expand All @@ -87,7 +87,7 @@ ebola_confirmed
# internal for DBI::dbWriteTable()
# read data
ebola_confirmed <- rio::import(
file.path("data", "ebola_cases.csv")
file.path("data", "ebola_cases_2.csv")
) %>%
dplyr::as_tibble() # for a simple data frame output

Expand All @@ -105,7 +105,7 @@ The `{here}` package is designed to simplify file referencing in R projects by p

- **Relative Paths**: Allows you to use relative file paths with respect to the `R` Project, making your code more portable and less error-prone.

- **Cross-Environment Compatibility**: Works across different operating systems (Windows, Mac, Linux) without needing to adjust file paths. This notation `here::here("data", "ebola_cases.csv")` avoids using `"data\ebola_cases.csv"` in some and `"data/ebola_cases.csv"` in others!
- **Cross-Environment Compatibility**: Works across different operating systems (Windows, Mac, Linux) without needing to adjust file paths. This notation `here::here("data", "ebola_cases_2.csv")` avoids using `"data\ebola_cases_2.csv"` in some and `"data/ebola_cases_2.csv"` in others!

- **Reduces Errors**: Avoids the need to use `setwd()` or absolute paths, reducing errors in scripts shared across machines. This avoids notations like `"C:/Users/mycomputer/Documents/projects/helloworld"`.

Expand Down
2 changes: 1 addition & 1 deletion learners/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
+ **Challenges**: complete challenges to test your understanding.
+ **Explainers**: add to your understanding of mathematical and modelling concepts with the explainer boxes.

Also check out the [glossary](../reference.md) for any terms you may be unfamiliar with.

Check warning on line 40 in learners/setup.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing file]: [glossary](../reference.md)

### Epiverse-TRACE R packages

Our strategy is to gradually incorporate specialised **R packages** into a traditional analysis pipeline. These packages should fill the gaps in these epidemiology-specific tasks in response to outbreaks.

![I](episodes/fig/pkgs-hexlogos-2.png).

Check warning on line 46 in learners/setup.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: episodes/fig/pkgs-hexlogos-2.png

<p><figure>
<img src="episodes/fig/pkgs-hexlogos-2.png"
Expand Down Expand Up @@ -281,7 +281,7 @@

The data files for the tutorial can be downloaded manually here:

- <https://epiverse-trace.github.io/tutorials-early/data/ebola_cases.csv>
- <https://epiverse-trace.github.io/tutorials-early/data/ebola_cases_2.csv>
- <https://epiverse-trace.github.io/tutorials-early/data/Marburg.zip>
- <https://epiverse-trace.github.io/tutorials-early/data/simulated_ebola_2.csv>

Expand Down
Loading