Learn R Programming

hierarchicalSets (version 1.0.4)

outlying_elements: Extract the outlying elements from each set pair

Description

This function detects the outlying elements of each pair of sets in a HierarchicalSet object. An outlying element is defined as an element in the intersection of the two sets, but not in the intersection of their nearest common set family in the hierarchy.

Usage

outlying_elements(x, counts = TRUE)

Value

A data.frame containing information on the outlying elements of each set pair. Only pairs with outlying elements are returned. The 'setX' coloumn contains the index of the first set in the pair and the 'setY' column contains the index of the second set in the pair. If counts = TRUE

then the 'nOutliers' column contains the number of outlying elements for each pair. If counts = FALSE the the 'outlier' column contains the index of the outlying elements for each pair

Arguments

x

A HierarchicalSet object

counts

Should number of elements rather than the actual elements be returned. Defaults to TRUE

See Also

plot_outlier_distribution() for plotting the distribution of outlying elements in a HierarchicalSet object

Examples

Run this code
data('twitter')

twitSet <- create_hierarchy(twitter)

# Just get the counts
countOut <- outlying_elements(twitSet)
head(countOut)

# Or the actual elements
elemOut <- outlying_elements(twitSet, FALSE)
head(elemOut)

Run the code above in your browser using DataLab