\name{and.segSet} \alias{and.segSet} \alias{and} \alias{and.default} %\alias{minimalSeg} \title{Intersection of segments} \description{ and(a,b) Computes intersection of two objects of class segSet a and b, i.e. returns segments that are both in a and b. % minimalSeg(a) compute the maximal common segment when several segments % overlap and singletons. When used with only one object of class segSet it returns the common segment of all segments of element 'a'. } \usage{ and.segSet(a, b = NULL,...) %minimalSeg(ranges) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{a,b}{elements of class segSet} \item{...}{Unused} } \value{ an element of class segSet. } \author{Antoine Lucas} \seealso{\link{globalSeg},\link{and.globalSeg}} \examples{ a = matrix(c(1,5,15,45,17,38, 100,120,130,140, 135,145,142,160), ncol=2,byrow=TRUE) b = matrix(c(15,18, 28,45, 1,10, 15,20, 25,40, 17,23, 35,38,100,105, 110,120),ncol=2,byrow=TRUE) a <- as.segSet(a) b <- as.segSet(b) c = and(a,b) par(mfrow=c(3,1)) plot(a,xlim=c(1,160)) plot(b,xlim=c(1,160)) plot(c,xlim=c(1,160)) ## Another sample a = matrix(c(1,30,40,50,60,70,80,110),ncol=2,byrow=TRUE) b = matrix(c(1,10,20,30,40,70,80,90,100,110),ncol=2,byrow=TRUE) a <- as.segSet(a) b <- as.segSet(b) c = and(a,b) par(mfrow=c(3,1)) plot(a,xlim=c(1,160),main="A") plot(b,xlim=c(1,160),main="B") plot(c,xlim=c(1,160),main="A&B") ## Show result c and(a) } \keyword{utilities}