-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
52 lines (35 loc) · 1.46 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
---
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%"
)
```
# playdata
<!-- badges: start -->
<!-- badges: end -->
The playdata package holds all of the internal datasets for the `playbase` package.
# Adding Rda datasets
If you have a dataset to add, you should do the following:
- read the dataset into R memory via the console
- make sure the dataset variable is named as it will be called in playdata
- run `usethis::use_data(DATASET_NAME)`
- add a documentation entry in `R/playdata-data.R`
- run `devtools::document()` to update the documentation
Now you can call the dataset via `playdata::DATASET_NAME`
# Adding non-Rda datasets
If you have a file to add that is not in Rda format, then do the following:
- add it to the `inst/extdata` folder
Then you can get the path to the file via `playdata::get_file(FILENAME)`
# Accessing playdata datasets dynamically
If you want to access playdata dataset dynamically, where for example the dataset
from playdata to be accessed is only known via a variable name, then use the
function `playdata::get_data(...)`.
For example, if you want to access the dataset `BLUERED`, you can simply call
`playdata::BLUERED`. But if `BLUERED` was a variable - e.g., `mycolor <- 'BLUERED'` -
then you can access the dataset via `playdata::get_data(mycolor)`.