Extract selections for a given solution from a RapResults() or RapSolved() object.

selections(x, y)

# S3 method for RapResults
selections(x, y = 0)

# S3 method for RapSolved
selections(x, y = 0)

Arguments

x

RapResults() or RapSolved() object.

y

NULL to return all values, integer 0 to return values for the best solution, integer value greater than 0 for y'th solution value.

Value

base::matrix() or numeric vector depending on arguments.

See also

Examples

# load data data(sim_rs) # selections for the best solution selections(sim_rs, 0)
#> [1] 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0 #> [38] 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 #> [75] 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1
# selections for the second solution selections(sim_rs, 2)
#> [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 #> [38] 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 #> [75] 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0
# selections for each solution selections(sim_rs)
#> [1] 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0 #> [38] 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 #> [75] 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1