Skip to content

Commit

Permalink
feat: add refrence lines + filter unwanted data
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhav committed Nov 22, 2024
1 parent 21eff43 commit ea67bd0
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions inst/poc_osprey.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ data <- within(teal_data(), {
library(osprey)

ADSL <- osprey::rADSL |>
mutate(x_val = as.integer(TRTEDTM - TRTSDTM))
ADRS <- osprey::rADRS
mutate(x_val = as.integer(TRTEDTM - TRTSDTM)) |>
arrange(x_val) |>
filter(!is.na(x_val))
ADRS <- osprey::rADRS |>
filter(ADY >= 0, USUBJID %in% ADSL$USUBJID)
reference_lines <- data.frame(x = c(50, 250), xend = c(50, 250), y = min(ADSL$USUBJID), yend = max(ADSL$USUBJID))
})

join_keys(data) <- default_cdisc_join_keys[c("ADSL", "ADRS")]
Expand All @@ -28,6 +32,20 @@ plotly_specs <- list(
size = 10,
color = "#329133"
)
),
list(
"plotly::add_segments",
data = quote(reference_lines),
x = ~x,
xend = ~xend,
y = ~y,
yend = ~yend,
line = list(
color = "#CA0E40",
width = 2,
dash = "dash"
),
showlegend = FALSE
)
)

Expand All @@ -37,7 +55,7 @@ app <- init(
teal_slice(
"ADSL",
"AGE",
selected = c(20, 23)
selected = c(24, 25)
),
teal_slice(
"ADRS",
Expand Down

0 comments on commit ea67bd0

Please sign in to comment.