Skip to contents

Plot Discovered Patterns

Usage

# S3 method for class 'patterns'
plot(x, n = 10L, prop = TRUE, group, global = TRUE, ...)

Arguments

x

[patterns]
Output of discover_patterns().

n

[integer(1): 10L]
Maximum number of patterns to include in the plot.

prop

[logical(1): TRUE]
Should outcome-specific count proportions be displayed in the plot? The default is TRUE. Ignored if outcome was not originally specified.

group

[character(1)]
Name of the outcome class to draw the plot for. If not provided, shows the counts and proportions by outcome class for each pattern. If provided, only the proportions of the specific class are drawn by pattern. Ignored if outcome was not originally specified.

global

[logical(1): TRUE]
Should a line be added showing the global proportion when group is provided? Also colors the patterns according to whether the proportion is above or below the global value.

...

Ignored.

Value

A ggplot object. ngrams <- discover_patterns(engagement, type = "ngram") plot(ngrams)