Learn R Programming

TopKLists (version 1.0.2)

prepare.idata: Prepare Idata vector of 0's and 1's

Description

Function creates a data stream vector of zeros and ones (Idata) based on the preselected distance delta of the paired ordered lists. The obtained vector is further used as an input for compute.stream, a function that estimates the index position of information degradation.

Usage

prepare.idata(x, d)

Arguments

x
Data matrix or data frame, where the columns represent the lists of objects ordered according those rankings obtained from two different assessments.
d
The maximal distance between two lists for a ranked object

Value

  • The result is an object of type Idata, which is a list containing the data stream vector of zeros and ones, and the information about the applied distance delta
  • IdataData stream vector of zeros and ones
  • deltaThe applied delta

Details

The data stream vector is created as follows: if diff(rank1, rank2) of an individual object is less or equal delta, then 1 is assigned; otherwise 0. The smaller the delta value, the stronger the assumption of concordance for the paired ranked lists. When delta=0, the condition returns 1 for an object if and only if its rankings in the two lists are identical (the two objects share the same row).

See Also

compute.stream

Examples

Run this code
set.seed(4568)
A <- sample(1:20, 20)
B <- sample(1:20, 20)
C <- sample(1:20, 20)
mm <- data.frame(A, B, C, row.names=LETTERS[1:20])
prepare.idata(mm, d=10)

# The breast cancer example
data(breast)
Idata1 = prepare.idata(breast[,c(1,3)], d=10)
# or 
Idata2 = prepare.idata(breast[,c(1,2)], d=10)
# compare to
Idata2 = prepare.idata(breast, d=10)

Run the code above in your browser using DataLab