| showplot | R Documentation |
Renders plots stored in an MRScatterPlots, GWASForestPlots,
or MRForestPlots object to the active graphics device. You can
display all plots or filter to a specific outcome, exposure, or
outcome-exposure pair.
showplot(object, outcome = NULL, exposure = NULL)
object |
An |
outcome |
Optional character string; if supplied, only plots whose outcome matches this value are displayed. |
exposure |
Optional character string; if supplied, only plots whose exposure matches this value are displayed. |
Filtering logic:
Both outcome and exposure supplied — displays
the single plot for that exact pair.
outcome only — displays all exposures for that
outcome.
exposure only — displays all outcomes for that
exposure.
Neither supplied — displays every plot in the object.
Invisibly returns object.
data("fi_49item")
input1 <- harmonize_mr_data(df = fi_49item)$input_df
outcome1 <- run_mr_analysis(MR_input_data = input1)
# Scatter plots
scatter <- plot_mr_scatter(MR_input_data = input1, summary_df = outcome1)
showplot(scatter)
showplot(scatter, outcome = "fi_49item")
showplot(scatter, outcome = "fi_49item", exposure = "Zn")
# GWAS forest plots
gwas_plots <- GWAS_forest(MR_input_data = input1, report_form = "Beta")
showplot(gwas_plots)
showplot(gwas_plots, exposure = "Zn")
# MR forest plots
mr_plots <- MR_forest(summary_df = outcome1, effect = "Beta")
showplot(mr_plots)
showplot(mr_plots, outcome = "fi_49item", exposure = "Zn")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.