create_hierarchy {hierarchicalSets}R Documentation

Create and store hierarchcical sets

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

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

Functions

Examples

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]]


[Package hierarchicalSets version 1.0.4 Index]