dat.sel: Generate Pairwise Data Set Based on Class Labels

Description Usage Arguments Details Value Author(s) Examples

View source: R/FIEmspro_accest.r

Description

Generate pairwise data set based on class labels.

Usage

1
  dat.sel(dat, cl, choices = NULL)

Arguments

dat

A data frame or matrix.

cl

A factor or vector of class.

choices

The vector or list of class labels to be chosen for binary classification.

Details

This function is used to provide the data set for the binary combination of the class factor. If choices is NULL, the binary combination of for all class labels will be done. If choices has one class label, the comparisons between this one and any other class are done. If choices has more than three class lables, enumerate the combinations or permutations of the elements of choices. For details, see examples below.

Value

A list with components:

dat

Pairwise data set.

cl

Pairwise class label.

com

A matrix of the combinations or permutations of the elements of pairwise vector.

Author(s)

Wanchang Lin wll@aber.ac.uk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(iris)
x <- subset(iris, select = -Species)
y <- iris$Species
 
## generate data set with class "setosa" and "virginica"
(binmat.1 <- dat.sel(x,y,choices=c("setosa","virginica")))

## generate data sets for "setosa" vs other classes. These are: 
## "setosa" and "versicolor", "setosa" and "virginica".
(binmat.2 <- dat.sel(x,y,choices=c("setosa")))

## generate data set with combination of each class. These are:  
## "setosa" and "versicolor", "setosa" and "virginica",  
## "versicolor" and "virginica" 
(binmat.3 <- dat.sel(x,y,choices= NULL))

aberHRML/FIEmspro documentation built on May 16, 2019, 6:56 p.m.