Improvement of `format_ae_listing()`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
Research direction
Start in R/ae_listing.R, especially format_ae_listing() and the linked ranges around lines 206-398, then reproduce the example using prepare_ae_forestly() and format_ae_forestly(). Check which required variables and data manipulations break listings without AREL; done means the listing works with the shown inputs and displays the source data without unnecessary transformations.
Written by the indexing model from the issue text.
Description
The following code works without AREL in the ae_listing_display =.... After a quick debuging, the error seems to come from format_ae_listing() (maybe from https://github.com/Merck/forestly/blob/main/R/ae_listing.R#L313-L398).
In format_ae_listing(), we defaultly requried some variables for AE listing, including the following:
- https://github.com/Merck/forestly/blob/main/R/ae_listing.R#L206-L216
- https://github.com/Merck/forestly/blob/main/R/ae_listing.R#L226-L275
- https://github.com/Merck/forestly/blob/main/R/ae_listing.R#L298-L311
Furthermore, we did some data manuplication (see below links), which is NOT required. We are suggested to display what's exactly the data. These manuplication can be time consuming.
- https://github.com/Merck/forestly/blob/main/R/ae_listing.R#L277-L296
- https://github.com/Merck/forestly/blob/main/R/ae_listing.R#L313-L398
adsl <- forestly_adsl
adae <- forestly_adae
adsl$TRTA <- factor(forestly_adsl$TRT01A,
levels = c("Xanomeline Low Dose", "Placebo"),
labels = c("Low Dose", "Placebo")
)
adae$TRTA <- factor(forestly_adae$TRTA,
levels = c("Xanomeline Low Dose", "Placebo"),
labels = c("Low Dose", "Placebo")
)
meta <- meta_adam(population = adsl, observation = adae) |>
define_plan(plan = plan(
analysis = "ae_forestly",
population = "apat",
observation = "apat",
parameter = "any;drug-related"
)) |>
define_analysis(name = "ae_forestly", label = "Interactive Forest Plot") |>
define_population(
name = "apat", group = "TRTA", id = "USUBJID",
subset = SAFFL == "Y", label = "All Patient as Treated"
) |>
define_observation(
name = "apat", group = "TRTA",
subset = SAFFL == "Y", label = "All Patient as Treated"
) |>
define_parameter(
name = "any",
subset = NULL,
label = "Any AEs",
var = "AEDECOD", soc = "AEBODSYS"
) |>
define_parameter(
name = "drug-related",
subset = toupper(AREL) == "RELATED",
label = "Drug-related AEs",
var = "AEDECOD", soc = "AEBODSYS"
) |>
meta_build()
meta |>
prepare_ae_forestly(ae_listing_display = c("USUBJID", "SITEID", "SEX", "RACE", "AGE", "AREL")) |>
format_ae_forestly() |>
ae_forestly()
- Dominant language
- R
- Stars
- 22
- Forks
- 6
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 10
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Merck/forestly
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
easystats/performance#950 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
briandconnelly/airnow#9 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OHDSI/CohortConstructor#774 ·
-
pre-review R TeX Track: 5 (DSAIS)
Difficulty 1/5 Under an hour Newbie friendliness 60/100
openjournals/joss-reviews#11330 · 7 comments ·