View source: R/NNCTFunctions.R
rct | R Documentation |
Returns the RCT given the IPD matrix or data set x
, the RCT is 2 \times 2
regardless of the
number of classes in the data set.
RCT is constructed by categorizing the NN pairs according to pair type as self or mixed and whether
the pair is reflexive or non-reflexive.
A base-NN pair is called a reflexive pair, if the elements of the pair are NN to each other;
a non-reflexive pair, if the elements of the pair are not NN to each other;
a self pair, if the elements of the pair are from the same class; a mixed pair, if the
elements of the pair are from different classes.
Row labels in the RCT are "ref"
for reflexive and "non-ref"
for non-reflexive and
column labels are "self"
and "mixed"
.
The argument is.ipd
is a logical argument (default=TRUE
) to determine the structure of the argument x
.
If TRUE
, x
is taken to be the inter-point distance (IPD) matrix, and if FALSE
, x
is taken to be the data set
with rows representing the data points.
See also (\insertCiteceyhan:NNreflexivity2017,ceyhan:NNreflex1D2018;textualnnspat) and the references therein.
rct(x, lab, is.ipd = TRUE, ...)
x |
The IPD matrix (if |
lab |
The |
is.ipd |
A logical parameter (default= |
... |
are for further arguments, such as |
Returns the 2 \times 2
RCT, see the description above for more detail.
Elvan Ceyhan
nnct
, tct
and scct
n<-20 #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(1:2,n,replace = TRUE) #or try cls<-rep(1:2,c(10,10))
ipd<-ipd.mat(Y)
rct(ipd,cls)
rct(Y,cls,is.ipd = FALSE)
rct(Y,cls,is.ipd = FALSE,method="max")
#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
rct(ipd,fcls)
#############
n<-40
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(1:4,n,replace = TRUE) #or try cls<-rep(1:2,c(10,10))
ipd<-ipd.mat(Y)
rct(ipd,cls)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.