% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mcml_pc.R
\name{as_networks}
\alias{as_networks}
\alias{as_networks.mcml_pc}
\alias{as_networks.default}
\title{Promote a psychometric MCML result to a network group}
\usage{
as_networks(x)

\method{as_networks}{mcml_pc}(x)

\method{as_networks}{default}(x)
}
\arguments{
\item{x}{An object to convert. The \code{mcml_pc} method (from
\code{\link{build_mcml_pc}}) is the primary path.}
}
\value{
A \code{netobject_group}: a named list whose first element is
\code{macro} (the cluster-level network), followed by one netobject per
non-singleton cluster.

The \code{mcml_pc} method returns a \code{netobject_group};
singleton clusters (no within-network) are dropped with a
\code{warning()}.

The default method returns the input unchanged if it is already a
\code{netobject_group}, otherwise it errors.
}
\description{
\code{as_networks()} is the psychometric-network counterpart of
\code{\link{as_tna}}. It promotes the cluster-level (macro) and
within-cluster networks produced by \code{\link{build_mcml_pc}} into a
single \code{netobject_group}, so the result flows into the same
downstream verbs as any other group of networks (\code{print()},
\code{summary()}, \code{plot()}, \code{\link{net_centrality}}).
}
\details{
Where \code{as_tna()} promotes \emph{transition} networks (directed,
row-normalised, with initial probabilities) and re-wraps raw matrices,
\code{as_networks()} promotes \emph{psychometric} networks (undirected;
correlation / partial-correlation / glasso). The macro and within-cluster
components of an \code{mcml_pc} object are already full netobjects carrying
their estimator, directedness and data, so this function assembles them
into a group rather than re-wrapping matrices.
}
\examples{
set.seed(1)
df <- as.data.frame(matrix(stats::rnorm(200 * 6), 200, 6))
names(df) <- c("a1", "a2", "a3", "b1", "b2", "b3")
clusters <- list(A = c("a1", "a2", "a3"), B = c("b1", "b2", "b3"))
fit <- build_mcml_pc(df, clusters, aggregation = "composite", method = "cor")
nets <- as_networks(fit)
nets
nets$macro$weights
}
\seealso{
\code{\link{build_mcml_pc}} to create the input,
\code{\link{as_tna}} for the transition-network counterpart.
}
