Skip to content

Commit 780924c

Browse files
committed
feat: reproduce the osprey example
1 parent f1b5d51 commit 780924c

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

inst/poc_osprey.R

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
pkgload::load_all("teal")
2+
pkgload::load_all("teal.widgets")
3+
pkgload::load_all("teal.modules.general")
4+
5+
data <- within(teal_data(), {
6+
library(dplyr)
7+
library(osprey)
8+
9+
ADSL <- osprey::rADSL[1:20, ]
10+
ADRS <- filter(rADRS, PARAMCD == "OVRINV")
11+
})
12+
13+
plotly_specs <- list(
14+
list(
15+
"plotly::add_bars",
16+
data = quote(ADSL),
17+
x = ~ as.integer(TRTEDTM - TRTSDTM), y = ~USUBJID, color = ~ARM,
18+
colors = c("A: Drug X" = "#343CFF", "B: Placebo" = "#FF484B", "C: Combination" = "#222222")
19+
),
20+
list(
21+
"plotly::add_markers",
22+
data = quote(left_join(ADSL, ADRS)),
23+
x = ~ADY, y = ~USUBJID, symbol = ~AVALC,
24+
marker = list(
25+
size = 10,
26+
color = "#329133"
27+
)
28+
)
29+
)
30+
31+
app <- init(
32+
data = data,
33+
modules = modules(
34+
tm_data_table(),
35+
tm_p_swimlane2(
36+
label = "Swimlane",
37+
plotly_specs = plotly_specs,
38+
title = "Swimlane Efficacy Plot",
39+
symbols = c("CR" = "circle", "PR" = "triangle-up", "SD" = "diamond-wide", "PD" = "square", "NE" = "x-thin-open")
40+
)
41+
)
42+
)
43+
44+
shinyApp(app$ui, app$server)

0 commit comments

Comments
 (0)