pairwise.lab {nnspat}R 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 (Ceyhan (2017)).

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

Ceyhan E (2017). “Cell-Specific and Post-hoc Spatial Clustering Tests Based on Nearest Neighbor Contingency Tables.” Journal of the Korean Statistical Society, 46(2), 219-245.

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")


[Package nnspat version 0.1.2 Index]