% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compositional.R, R/generics.R
\name{substitute_component.dist_structure}
\alias{substitute_component.dist_structure}
\alias{substitute_component}
\title{Substitute a component}
\usage{
\method{substitute_component}{dist_structure}(x, j, new_component)

substitute_component(x, j, new_component)
}
\arguments{
\item{x}{A \link{dist_structure} object.}

\item{j}{Component index.}

\item{new_component}{A dist-compatible object to install at position j.}
}
\value{
A new \link{dist_structure} object.
}
\description{
Return a new \link{dist_structure} with the j-th component replaced by
\code{new_component}. Topology is preserved; the returned object is a
\code{coherent_dist} with the same min_paths and the modified component
list.
}
