plot.fanc: Plot a Solution Path from a "fanc" Object

View source: R/plot.fanc.R

plot.fancR Documentation

Plot a Solution Path from a "fanc" Object

Description

This function plots the solution paths or heatmaps from a "fanc" object. By default it opens a self-contained, interactive HTML viewer in the browser or RStudio viewer pane (no additional packages required). The viewer has sliders for rho and gamma, buttons that jump to the model selected by AIC, BIC, CAIC or EBIC, and an overview mode showing every rho along the path at once. All data and code are embedded in the page, so it runs without a server and can be saved and shared as a single file via the file argument.

Usage

## S3 method for class 'fanc'
plot(x, Window.Height=500, type=NULL, df.method="active",
                    viewer=c("auto", "html", "base"), file=NULL,
                    rho.index=1, gamma.index=1, ...)

Arguments

x

Fitted "fanc" model object.

Window.Height

Maximum plot height in pixels for the HTML viewer. It does not change the internal layout of base R plots. It must be between 250 and 2000. The default is 500.

type

Two plot types are supported. If "path", the path diagram is depicted. If "heatmap", the heatmap is depicted. When NULL, a path diagram is used when there are fewer than 50 variables and fewer than seven factors; otherwise a heatmap is used. Explicitly requesting "path" with seven or more factors is allowed but produces a warning because the diagram may be difficult to read.

df.method

Two types of degrees of freedom are supported. If "reparametrization", the degrees of freedom of the MC+ are reparametrized based on the degrees of freedom of the lasso. If "active", the degrees of freedom are the number of nonzero parameters.

viewer

Viewer backend. "auto" opens the interactive HTML viewer in an interactive session (or whenever file is supplied) and otherwise falls back to a base R plot. "html" always builds the HTML viewer. "base" draws the selected indices with base graphics. Long labels in base R plots are reduced or abbreviated to fit the available space. Rendering non-ASCII labels depends on the fonts supported by the active graphics device.

file

Optional path for the generated HTML file. When NULL (default) a temporary file is used. Supplying a path writes a permanent, self-contained .html file that can be opened on any computer (no R required).

rho.index

Initial index of the rho value.

gamma.index

Initial index of the gamma value.

...

Reserved for compatibility; currently unused.

Value

For viewer="html" the path to the generated HTML file (invisibly); otherwise NULL (invisibly). Called for the side effect of drawing or opening the viewer.

Author(s)

Kei Hirose
mail@keihirose.com

References

Hirose, K. and Yamamoto, M. (2015). Sparse estimation via nonconcave penalized likelihood in a factor analysis model,
Statistics and Computing, 25, 633–648.

See Also

fanc and out objects.


fanc documentation built on July 26, 2026, 9:06 a.m.

Related to plot.fanc in fanc...