Skip to contents

This function defines the S3 plot method for objects of class pvEBayes.

Usage

# S3 method for class 'pvEBayes'
plot(x, type = "eyeplot", ...)

Arguments

x

a pvEBayes object, which is the output of the function pvEBayes or pvEBayes_tune.

type

character string determining the type of plot to show. Available choices are "eyeplot" which calls eyeplot_pvEBayes and "heatmap" which calls heatmap_pvEBayes. Note that the input for 'type' is case-sensitive.

...

additional arguments passed to heatmap_pvEBayes or eyeplot_pvEBayes.

Value

A ggplot object.

Examples


obj <- pvEBayes(statin2025_44, model = "general-gamma", alpha = 0.5)
#>  Fitting general-gamma model...
#>  Fitting general-gamma model... [323ms]
#> 
#>  Generating 1000 posterior draws...
#>  Generating 1000 posterior draws... [37ms]
#> 
#> Object of class 'pvEBayes'
#> 
#> General-gamma model with hyperparameter alpha = 0.5.
#> Estimated prior is a mixture of 18 gamma distributions.
#> 
#> Running time of the general-gamma model fitting: 0.3307 seconds.
#> Optimizer convergence: successful.
#> Running time for posterior draws 
#> (1000 signal strength posterior draws per AE-drug pair):0.0439 seconds.
#> 
#> Extract estimated prior parameters, discovered signals
#> and signal strength posterior draws using `summary()`.
plot(obj, type = "eyeplot")