funsOnevsRest: Functions for one versus rest type labeling

funsOnevsRestR Documentation

Functions for one versus rest type labeling

Description

Two functions: lab.onevsrest and classirest.

Both functions relabel the points, keeping class i label as is and relabeling the other classes as "rest". Used in the one-vs-rest type comparisons after the overall segregation test is found to be significant.

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

Usage

lab.onevsrest(i, lab)

classirest(i, lab)

Arguments

i

label of the class that is to be retained in the post-hoc comparison.

lab

The vector of class labels (numerical or categorical)

Value

Both functions return the data relabeled as class i label is retained and the remaining is relabeled as "rest".

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

pairwise.lab

Examples

n<-20  #or try sample(1:20,1)
cls<-sample(1:2,n,replace = TRUE)  #or try cls<-rep(1:2,c(10,10))
lab.onevsrest(1,cls)
classirest(2,cls)

#cls as a factor
na<-floor(n/2); nb<-n-na
fcls<-rep(c("a","b"),c(na,nb))
lab.onevsrest("a",fcls)
lab.onevsrest("b",fcls)
classirest("b",fcls)

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


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