adayim / consort

Create CONSORT diagrams for clinical studies.
Other
28 stars 4 forks source link

Creating CONSORT plot with exclusion side boxes of some cohorts #17

Closed JauntyJJS closed 10 months ago

JauntyJJS commented 1 year ago

Hi,

Hopefully, the issue could be reproduced.

I am creating a CONSORT diagram with three cohort with two of them having a side box to indicated how many data were excluded but one has no exclusion.

Below is what I have done.

library(consort)

consort_plot <- consort::add_box(
  txt = c("Cohort 1 (n=6)",
          "Cohort 2 (n=6)",
          "Cohort 3 (n=6)")
 ) |> 
 consort::add_side_box(
    txt = c("Excluded (n=1)",
            "Excluded (n=3)",
            "")
  ) |>
consort::add_box(
  txt = c("Cohort 1 (n=5)",
          "Cohort 2 (n=3)",
          "")
 ) |> 
consort::add_box(
  txt = c("Total (n=14)")
 )

plot(consort_plot, grViz = TRUE)

The output is as follows:

image

It seems that the arrow from "Cohort 3 (n=6)" to "Total (n=14)" is disconnected.

Is there a way to connect them together ?

adayim commented 10 months ago

Sorry for the delay and thank you for reporting this. I have made some changes to fix this bug, would you be able to test it and see if it works? You need to install it from GitHub. Thank you very much.

JauntyJJS commented 10 months ago

Hi @adayim ,

I just installed from Github and tried the code again. This time it works

image

JauntyJJS commented 10 months ago

I hope the bug fixed will be updated in the CRAN repository. Let me know when that is implemented. Thank you once again for taking a look at this.