| plot_data | R Documentation |
plot_data() is a small accessor for users who want to build custom
base-R, ggplot2, plotly, or table-based displays from mfrmr plot helpers.
It accepts an existing mfrm_plot_data object, or any mfrmr object whose
plot() method supports draw = FALSE. Use plot_data_components() first
when you want to inspect which components are available before extracting
one.
plot_data(x, component = NULL, type = NULL, ...)
x |
An |
component |
Optional single component name inside the reusable plot
data. When |
type |
Optional plot type passed to |
... |
Additional arguments passed to |
The full reusable plot-data list, or the selected component.
toy <- load_mfrmr_data("example_core")
fit <- fit_mfrm(toy, "Person", c("Rater", "Criterion"), "Score", maxit = 30)
wright_plot_data <- plot_data(fit, type = "wright")
names(wright_plot_data)
wright_table <- plot_data(fit, type = "wright", component = "locations")
head(wright_table)
curves <- category_curves_report(fit, theta_points = 51)
curve_long <- plot_data(curves, component = "plot_long")
head(curve_long[, c("PlotType", "Theta", "Series", "Value")])
pathway_long <- plot_data(fit, type = "pathway", component = "pathway_long")
head(pathway_long[, c("Layer", "CurveGroup", "Theta", "Value")])
pathway_fit <- plot_data(fit, type = "pathway", component = "fit_measures")
head(pathway_fit[, c("Facet", "Level", "Infit", "Outfit", "FitStatus")])
info <- compute_information(fit, theta_points = 51)
sem_long <- plot_data(
plot_information(info, type = "sem", draw = FALSE),
component = "plot_long"
)
head(sem_long[, c("Metric", "Theta", "Value", "DisplayedByDefault")])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.