HierarchicalSet object can be created using the hSet()
constructor.
The resulting object will contain both the underlying sets as well as the
resulting clustering.
create_hierarchy(sets, intersectLimit = 1)# S3 method for HierarchicalSet
print(x, ...)
# S3 method for HierarchicalSet
[[(x, i)
# S3 method for HierarchicalSet
[(x, i)
# S3 method for HierarchicalSet
sets(x)
# S3 method for HierarchicalSet
clusters(x)
# S3 method for HierarchicalSet
set_names(x)
# S3 method for HierarchicalSet
element_names(x)
# S3 method for HierarchicalSet
n_sets(x)
# S3 method for HierarchicalSet
length(x)
# S3 method for HierarchicalSet
n_elements(x)
# S3 method for HierarchicalSet
n_clusters(x)
# S3 method for HierarchicalSet
cluster_sizes(x)
# S3 method for HierarchicalSet
set_sizes(x)
# S3 method for HierarchicalSet
cluster_members(x)
# S3 method for HierarchicalSet
set_membership(x)
An object of class HierarchicalSet
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.
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
A HierarchicalSet object
Currently ignored
The index of the dendrogram
print(HierarchicalSet)
: Print method for HierarchicalSet objects
[[
: Extract dendrogram objects from HierarchicalSet objects
[
: Subset HierarchicalSet object by dendrogram (preserving set
information and class)
sets(HierarchicalSet)
: Extract the sets as a sparse matrix
clusters(HierarchicalSet)
: Extract the clusters as a list of dendrograms
set_names(HierarchicalSet)
: Get the names of the sets
element_names(HierarchicalSet)
: Get the names of the elements
n_sets(HierarchicalSet)
: Get the number of sets
length(HierarchicalSet)
: Get the number of sets
n_elements(HierarchicalSet)
: Get the number of elements
n_clusters(HierarchicalSet)
: Get the number of clusters
cluster_sizes(HierarchicalSet)
: Get the size of each clusters
set_sizes(HierarchicalSet)
: Get the size of each set
cluster_members(HierarchicalSet)
: Get the members of each clusters
set_membership(HierarchicalSet)
: Get the membership of each set
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()
.
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]]
Run the code above in your browser using DataLab