Learn R Programming

grip (version 0.1.2)

params.from.summary: Extract layout parameters from a comparison summary row

Description

Converts one row of the summary data frame returned by compare.layouts into a named list of parameters suitable for passing to grip or back into a compare.layouts(candidates = ...) call.

Usage

params.from.summary(summary.row)

Value

A named list with elements placement, rounds,

final_rounds, num_init, num_nbrs, r,

s, repulsion_factor, tinit_factor, and optionally

preset (included only when the summary row records a non-empty preset).

Arguments

summary.row

A one-row data frame (or the first row is used) from the $summary element of compare.layouts().

Examples

Run this code
edges <- edges.path(5)
cmp <- compare.layouts(edges, n = 5, dim = 2,
                            candidates = "default",
                            seeds = 1L)
params <- params.from.summary(cmp$summary[1, ])
coords <- do.call(
  grip,
  c(list(edges = edges, n = 5, dim = 2, seed = 42L), params)
)
round(coords, 2)

Run the code above in your browser using DataLab