mappeR: Main mappeR function

Description Usage Arguments Details Value Author(s) References Examples

Description

Runs the mappeR algorithm on a data set with the given parameters. The output is an adjacency matrix that specifies the edges between nodes (suitable for use with packages like igraph).

Usage

1
mappeR(X, n.slices, overlap, filterfn, clusterfn)

Arguments

X

Data matrix

n.slices

Number of overlapping subsets to slice the data into

overlap

Amount of overlap between clusters (0-50)

filterfn

Function to filter data

clusterfn

Function to cluster inside subsets

Details

A filter function should take as argument X and return a vector of length equal to the number of observations (rows) of X.
A cluster function should take as argument X (internally to mappeR, this will be the data in a slice), and return a list of cluster members.

Value

mappeR returns an object of class "mapper".

An object of class "mapper" is an environment containing at least the following components:

adjmat

Node adjacency matrix

filter.values

Vector of filter values taken by each observation in X

clusters

List of observations in each cluster

slices

Vector of number of clusters in each slice

Author(s)

Matthew Arnold

References

Singh, G., Memoli, F., Carlsson, G. (2007) Topological Methods for the Analysis of High Dimensional Data Sets and 3D Object Recognition

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# compare output to pairs plot of iris data
pairs(iris[,1:4], main = "Anderson's Iris Data -- 3 species",
      pch = 21, bg = c("red", "green3", "blue")[unclass(iris$Species)])

iris.mappeR.out <- mappeR(iris[,1:4],6,50,filterEccentricity,singlelinkagehist)

# find the iris types in each cluster (node)
iris.names <- lapply(iris.mappeR.out$clusters, function(x) return(substr(paste(unique(iris[x,5])),1,2)))
cluster.names <- sapply(iris.names, paste, collapse="/")

# plotting is done with igraph using the adjacency matrix in the mappeR output 
plot(iris.mappeR.out,vertex.label=cluster.names,vertex.size=30,edge.width=2)

# identify a circle
x <- runif(2000,0,2*pi)
X <- cbind(cos(x),sin(x))
plot(mappeR(X,6,50,filterCol1,singlelinkagehist))

arnhew99/mappeR documentation built on May 10, 2019, 1:45 p.m.