Skip to content

Commit

Permalink
docs(sessions): delete mmash folder in mmash.R script, so unzip is cl…
Browse files Browse the repository at this point in the history
…ean each time.

Closes #48
  • Loading branch information
lwjohnst86 committed May 4, 2024
1 parent 3629ae0 commit ed8d067
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions sessions/dplyr-joins.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -627,10 +627,10 @@ library(fs)
source(here("R/functions.R"))
```

Then, we will comment out the `download.file()`, `unzip()`,
`file_delete()`, and `file_move()` code, since we don't want to download
and unzip the data every single time we run this script. It should look
like this:
Making sure to have the `download.file()` commented out, we'll include
some code to delete the created `data-raw/mmash/` folder so this script
can run cleanly each time. Place the code right below where the
`download.file()` code is.

```{r data-raw-mmash-comment-out}
#| filename: "data-raw/mmash.R"
Expand All @@ -639,19 +639,8 @@ like this:
mmash_link <- "https://physionet.org/static/published-projects/mmash/multilevel-monitoring-of-activity-and-sleep-in-healthy-people-1.0.0.zip"
# download.file(mmash_link, destfile = here("data-raw/mmash-data.zip"))
# Unzip
# unzip(here("data-raw/mmash-data.zip"),
# exdir = here("data-raw"),
# junkpaths = TRUE)
# Sys.sleep(1)
# unzip(here("data-raw/MMASH.zip"),
# exdir = here("data-raw"))
# Remove/tidy up left over files
# file_delete(here(c("data-raw/MMASH.zip",
# "data-raw/SHA256SUMS.txt",
# "data-raw/LICENSE.txt")))
# file_move(here("data-raw/DataPaper"), here("data-raw/mmash"))
# Remove previous `mmash/` folder to have clean update
dir_delete(here("data-raw/mmash/"))
```

Go into the `doc/learning.qmd` and cut the code used to create the
Expand Down Expand Up @@ -737,3 +726,4 @@ next session.
rm(actigraph_df, rr_df)
save.image(here::here("_temp/dplyr-joins.RData"))
```

0 comments on commit ed8d067

Please sign in to comment.