-
Notifications
You must be signed in to change notification settings - Fork 1
/
boxly.Rmd
103 lines (81 loc) · 2.5 KB
/
boxly.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
---
title: "Interactive Box Plot"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Interactive Box Plot}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include=FALSE}
knitr::opts_chunk$set(
echo = TRUE,
collapse = TRUE,
eval = TRUE,
comment = "#>",
warning = FALSE,
message = FALSE
)
```
```{r}
library(boxly)
```
# Overview
Interactive box plots refers to the graphical representations that allow users to explore and
analyze data through an interactive interface. They provide a way to visualize the distribution,
central tendency, and variability of a dataset using a box-and-whisker plot, while also
providing additional interactivity for deeper exploration.
Some common interactive features of the box plots include:
- Hovering: When the user hovers the mouse cursor over a specific part of the plot, additional information
related to that specific data point or summary statistic is displayed. This includes the descriptive
statistics (N, Mean, Median, Q1, Q3, Min and Max), Subject ID and Change from Baseline
- Filtering: It is possible to apply filters to the data, enabling users to select specific Parameter
from a domain (Labs, Vitals, ECG)
# Mental model
Creating the box plot using this package involves the below steps:
- Create a list of metadata (Ex: meta) using `meta_boxly()`
- Call `prepare_boxly()` function to prepare the metadata as required by the user
- Call `boxly()` function to create the interactive plot
## Example 1: Interactive Box Plot Using Labs Data
Step1: Create a list of metadata (Ex: meta) using `meta_boxly()`
```{r}
meta <- meta_boxly(
boxly_adsl,
boxly_adlb,
population_term = "apat",
observation_term = "wk12",
observation_subset = AVISITN <= 12 & !is.na(CHG)
)
```
Step2: Call `prepare_boxly()` function to prepare the metadata as required by the user
```{r}
outdata <- prepare_boxly(meta)
outdata
```
Step 3: Call `boxly()` function to create the interactive plot
```{r}
boxly(outdata)
```
## Example 2: Interactive Box Plot Using Vital Signs Data
```{r}
meta_boxly(
boxly_adsl,
boxly_advs,
population_term = "apat",
observation_term = "wk12",
observation_subset = AVISITN <= 12 & !is.na(CHG)
) |>
prepare_boxly() |>
boxly()
```
## Example 3: Interactive Box Plot Using ECG Data
```{r}
meta_boxly(
boxly_adsl,
boxly_adeg,
population_term = "apat",
observation_term = "wk12",
observation_subset = AVISITN <= 12 & !is.na(CHG)
) |>
prepare_boxly() |>
boxly()
```