r<-2
c<-.4
a<-0; b<-10; int<-c(a,b)
Mc<-centMc(int,c)
n<-10
set.seed(1)
dat<-runif(n,a,b)
Gam1PE1D(dat[5],dat,r,c,int)
gam.vec<-vector()
for (i in 1:n)
{gam.vec<-c(gam.vec,Gam1PE1D(dat[i],dat,r,c,int))}
ind.gam1<-which(gam.vec==1)
ind.gam1
domset<-dat[ind.gam1]
if (length(ind.gam1)==0)
{domset<-NA}
#or try
Rv<-rv.mid.int(dat[5],c,int)$rv
Gam1PE1D(dat[5],dat,r,c,int,Rv)
Xlim<-range(a,b,dat)
xd<-Xlim[2]-Xlim[1]
plot(cbind(a,0),xlab="",pch=".",xlim=Xlim+xd*c(-.05,.05))
abline(h=0)
points(cbind(dat,0))
abline(v=c(a,b,Mc),col=c(1,1,2),lty=2)
points(cbind(domset,0),pch=4,col=2)
text(cbind(c(a,b,Mc),-0.1),c("a","b","Mc"))
Gam1PE1D(dat[5],dat,r,c,int)
n<-10
dat2<-runif(n,a+b,b+10)
Gam1PE1D(5,dat2,r,c,int)
Gam1PE1D(2,dat,r,c,int,ch.data.pnt = FALSE)
#gives an error message if ch.data.pnt = TRUE since point p is not a data point in Dt
Run the code above in your browser using DataLab