adayim / consort

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

vignette code fails #16

Closed shug0131 closed 10 months ago

shug0131 commented 1 year ago

The two examples in the "Working Example (Human Effort)" come back with errors

txt0 <- c("Study 1 (n=160)", "Study 2 (n=140)")
txt1 <- "Population (n=300)"
txt1_side <- "Excluded (n=15):\n\u2022 MRI not collected (n=3)\n\u2022 Tissues not collected (n=4)\n\u2022 Other (n=8)"

g <- add_box(txt = txt0) |>
  add_box(txt = txt1) |>
  add_side_box(txt = txt1_side) |> 
  add_box(txt = "Randomized (n=200)") |> 
  add_split(txt = c("Arm A (n=100)", "Arm B (n=100)")) |> 
  add_side_box(txt = c("Excluded (n=15):\n\u2022 MRI not collected (n=3)\n\u2022 Tissues not collected (n=4)\n\u2022 Other (n=8)",
                       "Excluded (n=7):\n\u2022 MRI not collected (n=3)\n\u2022 Tissues not collected (n=4)")) |> 
  add_box(txt = c("Final analysis (n=85)", "Final analysis (n=93)")) |> 
  add_label_box(txt = c("1" = "Screening",
                        "3" = "Randomized",
                        "4" = "Final analysis"))

says : Error in add_label_box(add_box(add_side_box(add_split(add_box(add_side_box(add_box(add_box(txt = txt0), : txt must of length one!

and

g <- add_box(txt = c("Study 1 (n=8)", "Study 2 (n=12)", "Study 3 (n=12)"))
g <- add_box(g, txt = "Included All (n=20)")

says: Error in Gmisc::coords(vert_box) : object 'vert_box' not found

adayim commented 1 year ago

Ah, I think you are using an old version. Can you install the most current version and try it again?