-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
105 lines (76 loc) · 2.75 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
105
---
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%"
)
```
# jamesclient
<!-- badges: start -->
[![R-CMD-check](https://github.com/growthcharts/jamesclient/workflows/R-CMD-check/badge.svg)](https://github.com/growthcharts/jamesclient/actions)
<!-- badges: end -->
The goal of `jamesclient` is to facilitate interaction for `R` users with the
**Joint Automatic Measurement and Evaluation System (JAMES)**.
JAMES is an online resource for creating growth charts and analysing growth curves.
## Installation
You can install the development version from [GitHub](https://github.com/) with:
``` r
install.packages("remotes")
remotes::install_github("growthcharts/jamesclient")
```
## Example
The primary functions are:
Function | Description
------------------- | -------------
`james_post` | Send POST request to JAMES
`james_get` | Send GET request to JAMES
`inspect_demodata()`| Upload demo child data and download parsed file
### `james_post()`
Upload BDS data
```{r}
library(jamesclient)
fn <- system.file("extdata", "bds_v3.0", "smocc", "Laura_S.json",
package = "jamesdemodata", mustWork = TRUE)
host <- "https://james.groeidiagrammen.nl"
r1 <- james_post(host = host, path = "data/upload/json", txt = fn)
r1$parsed
```
### `james_get()`
Get output from R console (just for checking)
```{r}
r2 <- james_get(host = host, path = paste(r1$session, "console", sep = "/"))
cat(r2$parsed, "\n")
```
For other end points, see <https://james.groeidiagrammen.nl>.
### `inspect_demodata()`
```{r example3}
library(jamesclient)
data <- inspect_demodata(name = "Anne_S", "smocc")
data
```
## Some older functions
Everything can be done with `james_post()` and `james_get()`. The functions below are not needed anymore, and will be deprecated in the future.
### `upload_txt()`
Upload BDS data and create a tibble on the server:
```{r example, eval=FALSE}
library(jamesclient)
fn <- file.path(path.package("jamesclient"), "testdata", "client3.json")
r1 <- upload_txt(fn)
browseURL(get_url(r1, "return"))
```
### `request_chart()`
Make a combined upload and automatic chartcode choice:
```{r example2, eval = FALSE}
r2 <- request_chart(fn, chartcode = "PJAHN27")
browseURL(get_url(r2, "svg"))
```
## Removed functions
Function | Description | Alternative |
----------------- | -------------------------------------| ----------------------- |
`request_site()` | Create personalised site | `james_post()` |
`upload_bds()` | Upload and parse data | `james_post()` |