plot_cluster: Plot estimated functions, faceted by cluster numbers, for a...

View source: R/plot_cluster.R

plot_clusterR Documentation

Plot estimated functions, faceted by cluster numbers, for a known clustering

Description

An internal function of the growfunctions package.

Usage

plot_cluster(
  y,
  H,
  sort = FALSE,
  sample_rate = 0.05,
  y.axis.label = NULL,
  smoother = TRUE,
  fade = 0.2,
  cluster_order = NULL,
  plot_render = TRUE
)

Arguments

y

An N x T matrix for a collection of functions.

H

An N x 1 with entries in 1,...,M of cluster assignments for the N units of y under a known clustering.

sort

An optional boolean input on whether to sort the cluster-indexed plot panels of function by size of cluster. Defaults sort = FALSE.

sample_rate

An optional numeric value in (0,1] indicating percent of functions to randomly sample within each cluster to address over-plotting. Defaults to 1.

y.axis.label

An optional text label for y-axis. Defaults to "function values".

smoother

An optional scalar boolean input indicating whether to co-plot a smoother line through the functions in each cluster.

fade

An optional numeric input in (0,1) indicating the degree of fading to apply to the plots of functions in each cluster-indexed panel. Defaults to fade = 0.2.

cluster_order

An optional numeric vector of length M, the number of clusters, indicating the order, from-to-right, for plotting the cluster-indexed panels.

plot_render

An optional boolean input indicating whether to render the plot. Defaults to plot_render = TRUE.

Value

A list object containing the plot of estimated functions, faceted by cluster, and the associated data.frame object.

p.basis

A ggplot2 plot object

map

A data.frame object listing the unit and associated cluster membership.

Author(s)

Terrance Savitsky tds151@gmail.com

See Also

gpdpgrow, gmrfdpgrow


growfunctions documentation built on June 22, 2024, 11:49 a.m.