cl2edges.std.tri: The closest points in a data set to edges in the standard...

View source: R/AuxExtrema.R

cl2edges.std.triR Documentation

The closest points in a data set to edges in the standard equilateral triangle

Description

An object of class "Extrema". Returns the closest points from the 2D data set, Xp, to the edges in the standard equilateral triangle T_e=T(A=(0,0),B=(1,0),C=(1/2,\sqrt{3}/2)).

ch.all.intri is for checking whether all data points are inside T_e (default is FALSE).

If some of the data points are not inside T_e and ch.all.intri=TRUE, then the function yields an error message. If some of the data points are not inside T_e and ch.all.intri=FALSE, then the function yields the closest points to edges among the data points inside T_e (yields NA if there are no data points inside T_e).

See also (\insertCiteceyhan:Phd-thesis,ceyhan:arc-density-PE,ceyhan:masa-2007;textualpcds).

Usage

cl2edges.std.tri(Xp, ch.all.intri = FALSE)

Arguments

Xp

A set of 2D points representing the set of data points.

ch.all.intri

A logical argument (default=FALSE) to check whether all data points are inside the standard equilateral triangle T_e. So, if it is TRUE, the function checks if all data points are inside the closure of the triangle (i.e., interior and boundary combined) else it does not.

Value

A list with the elements

txt1

Edge labels as AB=3, BC=1, and AC=2 for T_e (correspond to row number in Extremum Points).

txt2

A short description of the distances as "Distances to Edges ...".

type

Type of the extrema points

desc

A short description of the extrema points

mtitle

The "main" title for the plot of the extrema

ext

The extrema points, i.e., closest points to edges

X

The input data, Xp, which can be a matrix or data frame

num.points

The number of data points, i.e., size of Xp

supp

Support of the data points, i.e., the standard equilateral triangle T_e

cent

The center point used for construction of edge regions, not required for this extrema, hence it is NULL for this function

ncent

Name of the center, cent, not required for this extrema, hence it is NULL for this function

regions

Edge regions inside the triangle, T_e, not required for this extrema, hence it is NULL for this function

region.names

Names of the edge regions, not required for this extrema, hence it is NULL for this function

region.centers

Centers of mass of the edge regions inside T_e, not required for this extrema, hence it is NULL for this function

dist2ref

Distances from closest points in each edge region to the corresponding edge

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

cl2edges.vert.reg.basic.tri, cl2edgesMvert.reg, cl2edgesCMvert.reg and fr2edgesCMedge.reg.std.tri

Examples

## Not run: 
n<-20  #try also n<-100
Xp<-runif.std.tri(n)$gen.points

Ext<-cl2edges.std.tri(Xp)
Ext
summary(Ext)
plot(Ext,asp=1)

ed.clo<-Ext

A<-c(0,0); B<-c(1,0); C<-c(0.5,sqrt(3)/2);
Te<-rbind(A,B,C)
CM<-(A+B+C)/3
p1<-(A+B)/2
p2<-(B+C)/2
p3<-(A+C)/2

Xlim<-range(Te[,1],Xp[,1])
Ylim<-range(Te[,2],Xp[,2])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]

plot(A,pch=".",xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),
ylim=Ylim+yd*c(-.05,.05))
polygon(Te)
points(Xp,xlab="",ylab="")
points(ed.clo$ext,pty=2,pch=4,col="red")

txt<-rbind(Te,p1,p2,p3)
xc<-txt[,1]+c(-.03,.03,.03,0,0,0)
yc<-txt[,2]+c(.02,.02,.02,0,0,0)
txt.str<-c("A","B","C","re=1","re=2","re=3")
text(xc,yc,txt.str)

## End(Not run)


elvanceyhan/pcds documentation built on June 29, 2023, 8:12 a.m.