Last chance! 50% off unlimited learning
Sale ends in
Returns the index of the vertex in the interval, int
,
whose end interval contains the 1D point p
,
that is, it finds the index of the vertex for the point, p
, outside
the interval int
If the point, p
, is inside int
,
then the function yields NA
as output.
The corresponding vertex region is an interval
as rv=1
and if rv=2
.
Unlike rel.vert.mid.int
, centrality parameter (i.e., center
of the interval is not relevant for rel.vert.end.int
.)
See also (ceyhan:metrika-2012,ceyhan:revstat-2016;textualpcds).
rel.vert.end.int(p, int)
A list
with two elements
Index of the end vertex whose region contains point, p
.
The vertices of the interval as a vector
where position of the vertex corresponds to
the vertex index as int=(rv=1,rv=2)
.
A 1D point whose end interval region is provided by the function.
A vector
of two real numbers representing an interval.
Elvan Ceyhan
rel.vert.mid.int
# \donttest{
a<-0; b<-10; int<-c(a,b)
rel.vert.end.int(-6,int)
rel.vert.end.int(16,int)
n<-10
xf<-(int[2]-int[1])*.5
XpL<-runif(n,a-xf,a)
XpR<-runif(n,b,b+xf)
Xp<-c(XpL,XpR)
rel.vert.end.int(Xp[1],int)
Rv<-vector()
for (i in 1:length(Xp))
Rv<-c(Rv,rel.vert.end.int(Xp[i],int)$rv)
Rv
Xlim<-range(a,b,Xp)
xd<-Xlim[2]-Xlim[1]
plot(cbind(a,0),xlab="",pch=".",xlim=Xlim+xd*c(-.05,.05))
abline(h=0)
abline(v=c(a,b),col=1,lty = 2)
points(cbind(Xp,0))
text(cbind(Xp,0.1),labels=factor(Rv))
text(cbind(c(a,b),-0.1),c("rv=1","rv=2"))
jit<-.1
yjit<-runif(length(Xp),-jit,jit)
Xlim<-range(a,b,Xp)
xd<-Xlim[2]-Xlim[1]
plot(cbind(a,0),
main="vertex region indices for the points\n in the end intervals",
xlab=" ", ylab=" ",pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=3*range(yjit))
points(Xp, yjit,xlim=Xlim+xd*c(-.05,.05),pch=".",cex=3)
abline(h=0)
abline(v=c(a,b),lty = 2)
text(Xp,yjit,labels=factor(Rv))
text(cbind(c(a,b),-.01),c("rv=1","rv=2"))
# }
Run the code above in your browser using DataLab