Skip to contents

Assemble a multi-panel plot using the plotting functions of the Bmix package, with default parameters.

Usage

plot.bmix(x, ...)

Arguments

x

An object of class bmix that represents a fit.

...

The ellipsis should contain a data parameter storing the actual data used to compute the fit x.

Value

A cowplot figure.

Examples


# The same dataset used in the package vignette
data = data.frame(successes = c(rbinom(30, 100, .4), rbinom(70, 100, .7)), trials = 100)

# BMix fit with default parameters
x = bmixfit(data)
#> 
#> ── BMix fit ────────────────────────────────────────────────────────────────────
#> 
#> ℹ Binomials k_B = 1 and 2, Beta-Binomials k_BB = 0; 4 fits to run.
#> 
#> ℹ Bmix best fit completed in 0 mins
#> 
#> ── [ BMix ] My BMix model n = 100 with k = 2 component(s) (2 + 0) ──────────────
#> • Clusters: π = 70% [Bin 2] and 30% [Bin 1], with π > 0.
#> • Binomial Bin 1 with mean = 0.411074664346405.
#> • Binomial Bin 2 with mean = 0.699296680192309.
#> ℹ Score (model selection): ICL = 749.35.

# Empty plot
plot(x)
#> Warning: No data given in input, returning empty plot.


# Plot with data
plot(x, data)
#> Warning: Ignoring unknown parameters: `size`
#> Warning: The `<scale>` argument of `guides()` cannot be `FALSE`. Use "none" instead as
#> of ggplot2 3.3.4.
#> ℹ The deprecated feature was likely used in the BMix package.
#>   Please report the issue at <https://github.com/caravagnalab/BMix/issues>.
#> Warning: The dot-dot notation (`..count..`) was deprecated in ggplot2 3.4.0.
#> ℹ Please use `after_stat(count)` instead.
#> ℹ The deprecated feature was likely used in the BMix package.
#>   Please report the issue at <https://github.com/caravagnalab/BMix/issues>.
#> Warning: Removed 4 rows containing missing values or values outside the scale range
#> (`geom_bar()`).
#> Warning: Graphs cannot be horizontally aligned unless the axis parameter is set. Placing graphs unaligned.