% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plots.R
\name{plot_top_features}
\alias{plot_top_features}
\title{Plot the Top Selected Features of an IMR Fit}
\usage{
plot_top_features(
  object,
  top = 10,
  base_cex = 1,
  cex_names = NULL,
  cex_axis = NULL,
  cex_lab = NULL,
  cex_main = NULL,
  cex_legend = NULL,
  col = NULL,
  palette = "platform",
  reference = 0.5,
  show_source = TRUE,
  legend = TRUE,
  xlim = c(0, 1),
  mar = NULL,
  mgp = NULL,
  ...
)
}
\arguments{
\item{object}{A fitted object of class `"imr"` returned by [imr()].}

\item{top}{Integer; the number of highest-mPIP features to display
(default `10`).}

\item{base_cex}{Overall text-size multiplier. The `cex_*` arguments default
to values derived from this multiplier (default `1`).}

\item{cex_names}{Feature-label size multiplier. If `NULL`, a plot-specific
default derived from `base_cex` is used.}

\item{cex_axis}{Axis-label size multiplier. If `NULL`, a plot-specific
default derived from `base_cex` is used.}

\item{cex_lab}{Axis-title size multiplier. If `NULL`, a plot-specific
default derived from `base_cex` is used.}

\item{cex_main}{Main-title size multiplier. If `NULL`, a plot-specific
default derived from `base_cex` is used.}

\item{cex_legend}{Legend text size multiplier. If `NULL`, a plot-specific
default derived from `base_cex` is used.}

\item{col}{Optional bar colours. If `NULL`, colours are generated from
`palette`.}

\item{palette}{Palette name used when `col = NULL`; `"platform"` gives the
package's standard muted platform colours (default).}

\item{reference}{Optional vertical reference line; use `NULL` to suppress it
(default `0.5`).}

\item{show_source}{Logical; should each bar be annotated with the
availability subgroup (bitstring) in which the feature attained its maximum
mPIP (default `TRUE`)?}

\item{legend}{Logical; should the platform legend be drawn (default `TRUE`)?}

\item{xlim}{Numeric vector of length two giving the horizontal axis limits
(default `c(0, 1)`).}

\item{mar, mgp}{Optional graphical margin and axis-title placement vectors
passed to [graphics::par()] for finer layout control.}

\item{...}{Further graphical parameters passed to [graphics::barplot()].}
}
\value{
Invisibly, a data frame of the displayed features with columns
  `platform`, `feature`, `mpip` and `subgroup`, where `mpip` is the maximum
  subgroup mPIP for that platform-feature pair and `subgroup` is the
  subgroup where the maximum is attained. Rows are ordered by decreasing
  mPIP.
}
\description{
Draws a horizontal bar chart of the features with the highest marginal
posterior inclusion probability (mPIP).  For each platform-feature pair, the
plotted score is the highest mPIP attained among the availability subgroups
containing that platform; the displayed bars are the largest such scores
across all platforms.  This complements the per-platform heatmap of
`plot(fit, type = "selection")`.
}
\examples{
\donttest{
data("simIMR", package = "IntegMultiReg")
fit <- imr(
  platform_data_list = simIMR$platforms, outcome = simIMR$outcome,
  cov = simIMR$covariates, type_outcome = "binary",
  nu = c(-4, -3, -4), sample_mcmc = c(200, 100), ssize = 5, seed = 1
)
plot_top_features(fit, top = 8)
}
}
\seealso{
[imr()], [plot.imr()], [plot_subgroup_sizes()]
}
