partition (version 0.1.0)

plot_permutation: Plot permutation tests

Description

plot_permutation() takes the results of test_permutation() and plots the distribution of permuted partitions compared to the observed partition.

Usage

plot_permutation(permutations, .plot = c("information", "nclusters",
  "nreduced"), labeller = "target information:",
  perm_color = "#56B4EA", obs_color = "#CC78A8",
  geom = ggplot2::geom_density)

Arguments

permutations

a tibble, the result of test_permutation()

.plot

the variable to plot: observed information, the number of clusters created, or the number of observed variables reduced

labeller

the facet label

perm_color

the color of the permutation fill

obs_color

the color of the observed statistic line

geom

the geom to use. The default is geom_density.

Value

a ggplot

Examples

Run this code
# NOT RUN {
set.seed(123)
df <- simulate_block_data(c(3, 4, 5), lower_corr = .4, upper_corr = .6, n = 100)

test_permutation(df, partitioner = part_pc1(), nperm = 5) %>%
  plot_permutation("nclusters")

# }

Run the code above in your browser using DataCamp Workspace