-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.qmd
48 lines (32 loc) · 2.2 KB
/
README.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
title: "toolsheff"
format: gfm
---
Collection of general use functions. The to-do list is noted under [github.com/scc-pi/toolsheff/issues](https://github.com/scc-pi/toolsheff/issues).
## Use
To use the functions, add the following at the top of your R script (or in your `setup` R Markdown or Quarto chunk):
```{r}
#| eval: FALSE
source("https://raw.githubusercontent.com/scc-pi/toolsheff/main/R/_scc-tools.R")
```
## Development
If you've branched from `main` and are developing the functions, and want to use (or test) them, you could source from your local repo, for example:
```{r}
#| eval: FALSE
# source("https://raw.githubusercontent.com/scc-pi/toolsheff/main/R/_scc-tools.R")
source("C:/repo/toolsheff/R/_scc-tools.R")
```
## Project specific
You may have functions that are useful across different scripts but only within the context of a single project. In this scenario, you could add a similar script with functions (for example `_scc-tools-housing.R`), but within your project specific repo (for example [github.com/scc-pi/housing](https://github.com/scc-pi/housing)) rather than this repo ([github.com/scc-pi/toolsheff](https://github.com/scc-pi/toolsheff)). In which case you'd need to source a second file, for example:
```{r}
#| eval: FALSE
# source("https://raw.githubusercontent.com/scc-pi/toolsheff/main/R/_scc-tools.R")
source("C:/repo/toolsheff/R/_scc-tools.R")
source(here::here("R", "_scc-tools-housing.R"))
```
## Database connections
Even with hidden authorisation credentials, we don't want to store database addresses and port numbers in a public repo. So, this is something that will have to wait until we have secure private repos available via Azure DevOps.
## Plans
Data analysis at Sheffield Council is set to switch its default Git repository hosting from GitHub to Azure DevOps. When it does, we'll look at creating R packages for internal use via Continuous Integration. Until then this is a workaround.
## `{box}` R package
We've briefly tried the `{box}` R package to support modular code: [klmr.me/box](https://klmr.me/box/). We may review our use of it after we've established the convenience (or otherwise) of internal packages via Continuous Integration in Azure DevOps.