Skip to content

Commit

Permalink
Merge branch 'main' into vignettes-cleanup-logo-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
e-kotov committed Sep 4, 2024
2 parents fcb2868 + 5242c6e commit 96e018d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
39 changes: 39 additions & 0 deletions vignettes/_include/setup-data-directory.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
execute:
eval: false
---


## Set the data directory {#set-data-folder}

Choose where `{spanishoddata}` should download (and convert) the data by setting the `SPANISH_OD_DATA_DIR` environment variable with the following command:

```{r}
Sys.setenv(SPANISH_OD_DATA_DIR = "~/spanish_od_data")
```

The package will create this directory if it does not exist on the first run of any function that downloads the data.

<details><summary>Setting data directory for advanced users</summary>

To permanently set the directory for all projects, you can specify the data directory globally by setting the `SPANISH_OD_DATA_DIR` environment variable, e.g. with the following command:

```{r}
#| eval: false
usethis::edit_r_environ()
# Then set the data directory globally, by typing this line in the file:
```

```
SPANISH_OD_DATA_DIR = "~/spanish_od_data"
```

You can also set the data directory locally, just for the current project. Set the 'envar' in the working directory by editing `.Renviron` file in the root of the project:

```{r}
#| eval: false
file.edit(".Renviron")
```


</details>
1 change: 1 addition & 0 deletions vignettes/v1-2020-2021-mitma-data-codebook.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ remotes::install_github("Robinlovelace/spanishoddata",
force = TRUE, dependencies = TRUE)
```

Load the package:
Load the package:

```{r}
Expand Down

0 comments on commit 96e018d

Please sign in to comment.