insightsengineering / chevron

Standard TLGs For Clinical Trials Reporting
https://insightsengineering.github.io/chevron/
Other
8 stars 1 forks source link

Console output when running graph type of the output #705

Open pawelru opened 9 months ago

pawelru commented 9 months ago

Example (copied from the catalog):

ggtheme <- ggplot2::theme(
  panel.grid = ggplot2::element_line(colour = "black", linetype = 3),
  panel.background = ggplot2::element_rect(fill = "white"),
  legend.position = "top",
  axis.text.x = ggplot2::element_text(angle = 22, hjust = 1, vjust = 1)
)
run(mng01, syn_data, dataset = "adlb", ggtheme = ggtheme)

Console output:

r$> ggtheme <- ggplot2::theme(
      panel.grid = ggplot2::element_line(colour = "black", linetype = 
    3),
      panel.background = ggplot2::element_rect(fill = "white"),
      legend.position = "top",
      axis.text.x = ggplot2::element_text(angle = 22, hjust = 1, vjust
     = 1)
    )
    run(mng01, syn_data, dataset = "adlb", ggtheme = ggtheme)
$`Alanine Aminotransferase Measurement`

$`C-Reactive Protein Measurement`

$`Immunoglobulin A Measurement`

attr(,"class")
[1] "gg_list" "list"

This is also observed in the catalog (this could be silenced though)

I think we should avoid putting those debug statements in the console. Plot names are anyway putted inside the plot as a titles.

clarkliming commented 9 months ago

this is not debug information, but the show method for list. for the list we first print its name and then print its content, however its content is a ggplot object so it will only be printed in the current device (plot panel).

I agree that this can be improved, but should not be that urgent. anyway if you save it as some variable it won't get printed