getSolutionAttributes function

Retrieve constraints-related attributes from solution

Retrieve constraints-related attributes from solution

getSolutionAttributes is a helper function for retrieving constraints-related attributes from a solution.

getSolutionAttributes(constraints, item_idx, all_values = FALSE)

Arguments

  • constraints: a constraints object.
  • item_idx: item indices from a solution.
  • all_values: if TRUE, return all values as-is without taking the mean when there are multiple values. If FALSE, return the mean when there are multiple values. This has an effect when there is a constraint on items per stimulus, where there are multiple values of number of items per stimulus. In this case, if TRUE, the number of items for every stimuli are returned as-is. If FALSE, the average number of items across stimuli is returned. (default = FALSE)

Returns

  • If all_values == FALSE, getSolutionAttributes returns a data.frame containing constraints data and their associated attributes.
  • If all_values == TRUE, getSolutionAttributes returns a list containing attributes associated to each constraint.

Examples

item_idx <- c( 29, 33, 26, 36, 34, 295, 289, 296, 291, 126, 133, 124, 134, 129, 38, 47, 39, 41, 46, 45, 167, 166, 170, 168, 113, 116, 119, 117, 118, 114) getSolutionAttributes(constraints_reading, item_idx, FALSE) getSolutionAttributes(constraints_reading, item_idx, TRUE)
  • Maintainer: Seung W. Choi
  • License: GPL (>= 2)
  • Last published: 2024-08-22