Build a qeviz ModelData list from data.frames
qe_model_data.RdAssembles the ModelData structure consumed by <qe-visual> from
pre-prepared data.frames. All data.frames are converted to QEFrames
(see qe_frame()).
Usage
qe_model_data(
nodes,
edges,
points = NULL,
groups = NULL,
directed = FALSE,
id_col = "ENA_UNIT",
node_id_col = "code",
x_col = "x",
y_col = "y",
group_col = "Condition"
)Arguments
- nodes
data.frameof code-node positions. Must contain columnsnode_id_col,x_col,y_col.- edges
data.frameof edge weights. Must containid_colplus one column per edge pair (e.g.Data.Collaboration).- points
data.frameof unit positions. Must containid_col,group_col,x_col,y_col.- groups
data.frameof group summary statistics as returned bygroup_summary(), orNULLto compute automatically frompoints.- directed
Logical.
TRUEfor ONA (ordered/directed) models.- id_col
Name of the unit-ID column in
edgesandpoints.- node_id_col
Name of the code-ID column in
nodes.- x_col
Name of the x-coordinate column.
- y_col
Name of the y-coordinate column.
- group_col
Name of the group column in
points.
Value
A named list suitable for serialisation with jsonlite::toJSON()
and passing to qe_export_html() or qe_plot().
Examples
if (FALSE) { # \dontrun{
model <- qe_model_data(nodes_df, edges_df, points_df, directed = FALSE)
qe_plot(model)
} # }