pairwise.lab: Keeping the pair of the specified labels in the data

View source: R/NNCTFunctions.R

pairwise.labR Documentation

Keeping the pair of the specified labels in the data

Description

Keeps only the specified labels i and j and returns the data from classes with these labels and also the corresponding label vector having class labels i and j only.

See also (\insertCiteceyhan:jkss-posthoc-2017;textualnnspat).

Usage

pairwise.lab(dat, lab, i, j)

Arguments

dat

The data set in one or higher dimensions, each row corresponds to a data point.

lab

The vector of class labels (numerical or categorical)

i, j

Label of the classes that are to be retained in the post-hoc comparison.

Value

A list with two elements

data.pair

The type of the pattern from which points are to be generated

lab.pair

The "main" title for the plot of the point pattern

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

lab.onevsrest and classirest

Examples

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))
pairwise.lab(Y,cls,1,2)

#############
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))
pairwise.lab(Y,cls,2,3)

#cls as a factor
fcls<-rep(letters[1:4],rep(10,4))
pairwise.lab(Y,fcls,"b","c")


nnspat documentation built on May 29, 2024, 10:03 a.m.