% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/robustness.R
\name{ggplot_robustness}
\alias{ggplot_robustness}
\title{Compare Network Robustness (ggplot2)}
\usage{
ggplot_robustness(
  ...,
  networks = NULL,
  measures = c("betweenness", "degree", "random"),
  strategy = "sequential",
  colors = NULL,
  title = NULL,
  n_iter = 1000,
  seed = NULL,
  type = "vertex",
  ncol = NULL,
  free_y = FALSE
)
}
\arguments{
\item{...}{Named arguments: network names as names, network objects as values.}

\item{networks}{Named list of networks (alternative to ...).}

\item{measures}{Attack strategies to compare. Default c("betweenness", "degree", "random").}

\item{strategy}{Character string; "sequential" (default) recalculates centrality
after each removal, "static" uses initial centrality ranking throughout.}

\item{colors}{Named vector of colors for measures.}

\item{title}{Overall title. Default NULL.}

\item{n_iter}{Iterations for random. Default 1000.}

\item{seed}{Random seed. Default NULL.}

\item{type}{Removal type. Default "vertex".}

\item{ncol}{Columns in facet. Default NULL (auto).}

\item{free_y}{If TRUE, allow different y-axis scales per facet. Default FALSE.}
}
\value{
A ggplot2 object.
}
\description{
Creates a ggplot2 faceted visualization comparing robustness across
multiple networks. Produces publication-quality figures similar to
those in Nature Scientific Reports.
}
\examples{
if (requireNamespace("igraph", quietly = TRUE) &&
    requireNamespace("ggplot2", quietly = TRUE)) {

  g1 <- igraph::sample_pa(40, m = 2, directed = FALSE)
  g2 <- igraph::sample_gnp(40, 0.15)

  ggplot_robustness(
    "Teaching network" = g1,
    "Collaborative network" = g2,
    n_iter = 20
  )
}
}
