-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
106 lines (72 loc) · 3 KB
/
README.Rmd
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
<!-- badges: start -->
[![Codecov test coverage](https://codecov.io/gh/sol-eng/accesstocare/branch/main/graph/badge.svg)](https://codecov.io/gh/sol-eng/accesstocare?branch=main)
[![R-CMD-check](https://github.com/sol-eng/accesstocare/workflows/R-CMD-check/badge.svg)](https://github.com/sol-eng/accesstocare/actions)
<!-- badges: end -->
- [Access to Care](#access-to-care)
- [Analysis Background](#analysis-background)
- [Installation](#installation)
- [Usage](#usage)
- [Run an example](#run-an-example)
- [Copy example](#copy-example)
- [Copy all examples](#copy-all-examples)
## Access to Care
An R package to make it easy to view, copy, interact and publish the data products resulting from the Access to Care analysis. It also contains handly utlity functions, and the data needed to create a consistent set of examples across the multiple data product types.
## Analysis Background
This project combines US CENSUS population data with hospital data provided by Medicare. A linear model is used to determine if a county is over, or under served based on the size of the population.
## Installation
Install `accesstocare` from GitHub using:
```{r, eval = FALSE}
devtools::install_github("sol-eng/accesstocare")
```
## Usage
```{r}
library(accesstocare)
```
To view the available examples, use `atc_packate_content()`. It returns a `list` object with all of the available content. It is presented in the console, or RMarkdown, as a table.
```{r}
atc_package_content()
```
There are three ways to use the examples:
- Open an example in your RStudio session - `atc_open_content()`
- Copy a single example to disk - `atc_copy_content()`
- Copy all examples to disk - `atc_copy_all_content()`
### Run an example
```{r, eval = FALSE}
atc_open_content()
```
```{r, echo = FALSE}
atc_package_content()
cat("17 Cancel ")
cat("Enter the content number: ")
```
Enter the number to the left of the example in order to run it. For example, to open the `flexdashboard` example, type 3 and press enter.
To run an example without the prompt, pass the `content_no` argument with the number. Again, to open the `flexdashboard` use:
```{r, eval = FALSE}
atc_open_content(3)
```
### Copy example
An example can be copied to your working directory by using `atc_copy_content()`. It will create a new sub-folder and load the files for that particular example.
It has the same interactive mechanism as the open example function.
```{r, eval = FALSE}
atc_copy_content()
```
```{r, echo = FALSE}
atc_package_content()
cat("17 Cancel ")
cat("Enter the content number: ")
```
To avoid the interactive menu, pass the number to the left of the example, as an argument of the function:
```{r, eval = FALSE}
atc_copy_content(3) # Copies the `flexdashboard` folder
```
### Copy all examples
`atc_copy_all_content()` will copy all of the examples. It will as many sub-folders as there are examples available.