-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
63 lines (47 loc) · 1.55 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# chartbox
<!-- badges: start -->
[![R-CMD-check](https://github.com/growthcharts/chartbox/workflows/R-CMD-check/badge.svg)](https://github.com/growthcharts/chartbox/actions)
[![R-CMD-check](https://github.com/growthcharts/chartbox/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/growthcharts/chartbox/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
The `chartbox` package stores empty Dutch growth charts.
With the package you can
- list the available growth charts;
- set the color palette;
- load one of the growth charts for further processing.
## Installation
The following statements will install the `chartbox` package
```{r eval = FALSE}
install.packages("remotes")
remotes::install_github("growthcharts/chartbox")
```
## Example
The `load_chart()` function makes the stored growth charts available
for further processing. Here's an example that writes chart `PJAAN25`
to a PDF file.
```{r example}
library(chartbox)
# choose and load chart
chartcode <- "PJAAN25"
g <- load_chart(chartcode)
# set the correct color palette
pop <- chartcatalog::parse_chartcode(chartcode)$population
old_pal <- palette(palettes[pop, ])
# create the pdf
pdf(paste(chartcode, "pdf", sep = "."), height = 29.7/2.54, width = 21/2.54)
grid::grid.draw(g)
dev.off()
# restore palette
palette(old_pal)
```