View source: R/inspectSolution.R
inspectSolution | R Documentation |
useSolver
outputProcess a useSolver
output of a successfully solved optimization problem to a list so it becomes humanly readable.
inspectSolution( solverOut, items, idCol, colNames = names(items), colSums = TRUE )
solverOut |
Object created by |
items |
Original |
idCol |
Column name in |
colNames |
Which columns should be used from the |
colSums |
Should column sums be calculated in the output? Only works if all columns are numeric. |
This function merges the initial item pool information in items
to the solver output in solverOut
.
Relevant columns can be selected via colNames
. Column sums within test forms are calculated if possible and
if colSum
is set to TRUE
.
A list
with assembled blocks as entries. Rows are the individual items. A final row is added, containing
the sums of each column.
## Example item pool items <- data.frame(ID = 1:10, itemValues = c(-4, -4, -2, -2, -1, -1, 20, 20, 0, 0)) ## Test Assembly usage <- itemUsageConstraint(nForms = 2, operator = "=", targetValue = 1, itemIDs = items$ID) perForm <- itemsPerFormConstraint(nForms = 2, operator = "=", targetValue = 5, itemIDs = items$ID) target <- minimaxObjective(nForms = 2, itemValues = items$itemValues, targetValue = 0, itemIDs = items$ID) sol <- useSolver(allConstraints = list(usage, perForm, target), solver = "lpSolve") ## Inspect Solution out <- inspectSolution(sol, items = items, idCol = 1, colNames = "itemValues")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.