| Title: | Parse and Visualize Facets Output Files |
|---|---|
| Description: | Utilities to parse output files from 'Facets' (a software widely used for multi-facet Rasch measurement) and build accurate visualizations from the measurement reports. For more details on the underlying measurement framework, see Linacre (1994, ISBN:0-941938-02-6) and Linacre (2023) <https://www.winsteps.com/a/Facets-Manual.pdf>. |
| Authors: | Muhammad Yoga Prabowo [aut, cre] |
| Maintainer: | Muhammad Yoga Prabowo <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-07-22 14:48:49 UTC |
| Source: | https://github.com/myprabowo/facetsviz |
The facetsviz package parses FACETS .out files and renders common
multi-facet Rasch measurement plots, including Wright maps, severity
distributions, criterion diagnostics, rating-scale diagnostics, and unexpected
response summaries.
read_facets()
render_facets_plots()
render_facets_batch()
run_app()
Facets plotting theme
facets_theme(base_size = 11, base_family = "Helvetica")facets_theme(base_size = 11, base_family = "Helvetica")
base_size |
Base text size. |
base_family |
Base font family. |
A ggplot2 theme object.
Plot the distribution of measures for a facet
plot_distribution(x, facet_index = 2L, binwidth = 0.75)plot_distribution(x, facet_index = 2L, binwidth = 0.75)
x |
A 'facets_out' object or path to a FACETS '.out' file. |
facet_index |
Which measurement report to plot (default '2L'). |
binwidth |
Histogram bin width in logits. |
A ggplot object.
Plot measure estimates with standard errors for a facet
plot_estimates(x, facet_index = 3L)plot_estimates(x, facet_index = 3L)
x |
A 'facets_out' object or path to a FACETS '.out' file. |
facet_index |
Which measurement report to plot (default '3L'). |
A ggplot object.
Plot representative observed versus fair averages for a facet
plot_fairness(x, facet_index = 1L, n = 8L)plot_fairness(x, facet_index = 1L, n = 8L)
x |
A 'facets_out' object or path to a FACETS '.out' file. |
facet_index |
Which measurement report to plot (default '1L'). |
n |
Number of representative elements to show. |
A ggplot object.
Plot the expected-score ogive implied by Table 8.1 thresholds
plot_ogive(x, theta = NULL)plot_ogive(x, theta = NULL)
x |
A 'facets_out' object or path to a FACETS '.out' file. |
theta |
Optional vector of theta values. |
A ggplot object.
Plot rating-scale category probability curves
plot_probability(x, theta = NULL)plot_probability(x, theta = NULL)
x |
A 'facets_out' object or path to a FACETS '.out' file. |
theta |
Optional vector of theta values. |
A ggplot object.
Plot mode, median, and mean category regions from rating-scale thresholds
plot_structure(x, theta = NULL)plot_structure(x, theta = NULL)
x |
A 'facets_out' object or path to a FACETS '.out' file. |
theta |
Optional vector of theta values. |
A ggplot object.
Plot the strongest unexpected responses from Table 4.1
plot_unexpected(x, top_n = 20L)plot_unexpected(x, top_n = 20L)
x |
A 'facets_out' object or path to a FACETS '.out' file. |
top_n |
Number of rows to show. |
A ggplot object.
Plot rating-scale category usage frequencies
plot_usage(x)plot_usage(x)
x |
A 'facets_out' object or path to a FACETS '.out' file. |
A ggplot object.
Plot a compact Wright map across available facets
plot_wright(x)plot_wright(x)
x |
A 'facets_out' object or path to a FACETS '.out' file. |
A ggplot object.
Reads a FACETS '.out' file and parses the main FACETS tables used by the package.
read_facets(path, encoding = "UTF-8")read_facets(path, encoding = "UTF-8")
path |
Path to a FACETS '.out' file. |
encoding |
Text encoding used when reading the file. |
An object of class 'facets_out'.
Render FACETS plots for multiple output files
render_batch( paths = ".", output_root, recursive = TRUE, include = c("wright_map", "observed_vs_fair", "measure_distribution", "estimates", "category_usage", "probability_curves", "expected_score_ogive", "scale_structure", "unexpected_responses"), formats = c("png", "tiff"), dpi = 600, top_n_unexpected = 20L )render_batch( paths = ".", output_root, recursive = TRUE, include = c("wright_map", "observed_vs_fair", "measure_distribution", "estimates", "category_usage", "probability_curves", "expected_score_ogive", "scale_structure", "unexpected_responses"), formats = c("png", "tiff"), dpi = 600, top_n_unexpected = 20L )
paths |
One or more FACETS '.out' or '.txt' files or directories containing them. |
output_root |
Root directory for rendered plot folders. |
recursive |
Whether to search directories recursively. |
include |
Plot names passed to [render_plots()]. |
formats |
File formats passed to [render_plots()]. |
dpi |
Image resolution. |
top_n_unexpected |
Number of unexpected responses to show. |
A tibble describing rendered outputs.
Render a standard set of FACETS visualizations to disk
render_plots( x, output_dir, include = c("wright_map", "observed_vs_fair", "measure_distribution", "estimates", "category_usage", "probability_curves", "expected_score_ogive", "scale_structure", "unexpected_responses"), formats = c("png", "tiff"), dpi = 600, top_n_unexpected = 20L )render_plots( x, output_dir, include = c("wright_map", "observed_vs_fair", "measure_distribution", "estimates", "category_usage", "probability_curves", "expected_score_ogive", "scale_structure", "unexpected_responses"), formats = c("png", "tiff"), dpi = 600, top_n_unexpected = 20L )
x |
A 'facets_out' object or path to a FACETS '.out' file. |
output_dir |
Output directory for image files. |
include |
Character vector of plot names to render. |
formats |
File formats to write, such as '"png"' or '"tiff"'. |
dpi |
Image resolution. |
top_n_unexpected |
Number of unexpected responses to show when rendering that plot. |
Invisibly, a named list of generated file paths.
Launch the facetsviz Shiny app
run_app(launch = TRUE, host = "127.0.0.1", port = NULL)run_app(launch = TRUE, host = "127.0.0.1", port = NULL)
launch |
If 'TRUE', run the app immediately. If 'FALSE', return the app object. |
host |
Host passed to [shiny::runApp()] when launching. |
port |
Port passed to [shiny::runApp()] when launching. |
A shiny app object when 'launch = FALSE', otherwise the result of [shiny::runApp()].