\name{relist}
\alias{relist}
\alias{relistage}

\title{Group segments into global segments}
\description{
  Relist,Relistage : put all segments into its specific enveloppe. 

  
}
\usage{
relist(ranges, envel)
relistage(ranges, envel)
}

\arguments{
  \item{envel,ranges}{elements of class segSet or matrix nx2}
}

\value{
  \item{Relist}{a vector with envelopes indices  (-1 if none found)}
\item{Relistage}{a element of class globalSeg}
}

\author{Antoine Lucas and Odile Rogier}

\note{Envelops must overlap ranges.}

\examples{

from = c(1, 15,17,100,130,135,142)
to   = c(40,45,38,120,140,145,160)
envelfrom = c(1,100,130)
envelto = c(45,120,160)
ranges = as.segSet(data.frame(from,to))
envel = as.segSet(data.frame(envelfrom,envelto))

relist(ranges, envel)
c = relistage(ranges, envel)

par(mfrow=c(3,1))
plot(ranges,xlim=c(1,160),main="ranges")
plot(envel,xlim=c(1,160),main="Envelopes")
plot(c,xlim=c(1,160),main="relist")



}
\keyword{utilities}