create_hierarchy: Create and store hierarchcical sets

Description Usage Arguments Details Value Methods (by generic) Examples

Description

HierarchicalSet object can be created using the hSet() constructor. The resulting object will contain both the underlying sets as well as the resulting clustering.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
create_hierarchy(sets, intersectLimit = 1)

## S3 method for class 'HierarchicalSet'
print(x, ...)

## S3 method for class 'HierarchicalSet'
x[[i]]

## S3 method for class 'HierarchicalSet'
x[i]

## S3 method for class 'HierarchicalSet'
sets(x)

## S3 method for class 'HierarchicalSet'
clusters(x)

## S3 method for class 'HierarchicalSet'
set_names(x)

## S3 method for class 'HierarchicalSet'
element_names(x)

## S3 method for class 'HierarchicalSet'
n_sets(x)

## S3 method for class 'HierarchicalSet'
length(x)

## S3 method for class 'HierarchicalSet'
n_elements(x)

## S3 method for class 'HierarchicalSet'
n_clusters(x)

## S3 method for class 'HierarchicalSet'
cluster_sizes(x)

## S3 method for class 'HierarchicalSet'
set_sizes(x)

## S3 method for class 'HierarchicalSet'
cluster_members(x)

## S3 method for class 'HierarchicalSet'
set_membership(x)

Arguments

sets

The sets to analyse. Can either be a matrix/data.frame giving the presence/absence pattern of elements, with elements as rows and sets as columns, or a list of vectors giving the elements of the individual sets.

intersectLimit

The proportion of sets an element must be present in to be considered part of the intersect. Standard intersects require it to be present in all sets (intersectLimit = 1), which is also the default

x

A HierarchicalSet object

...

Currently ignored

i

The index of the dendrogram

Details

The HierarchicalSet class contains both the clustering and the original sets. The former is stored in a list of dendrogram objects in and the latter as a presence/absence matrix. Both are retrivable using $clusters and $sets respectively. Furthermore individual dendrograms can be extracted directly using the [[ operator. If multiple independent clusters exists the object can be subsetted using the [ operator.

For plotting functionality see the separate plot documentation for plot.HierarchicalSet().

Value

An object of class HierarchicalSet

Methods (by generic)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data('twitter')

# Caclulate the clustering
twitSet <- create_hierarchy(twitter)

# Some statistics on the data
n_sets(twitSet)
n_elements(twitSet)
n_clusters(twitSet)

# Focus on the first two independent cluster
twitSet[1:2]

# Extract a dendrogram representation of the firrst cluster
twitSet[[1]]

thomasp85/hierarchicalSets documentation built on May 31, 2019, 11:14 a.m.