This function retrieves a sample of efficacies from an object based on a provided seed.

get_efficacies_sample(object, seed)

Arguments

object

An object containing efficacies in a list format.

seed

An integer representing the seed to select the sample from the efficacies.

Value

A list containing the sampled efficacies for each efficacy type.

Details

The function initializes a list with efficacy types set to 0. It then iterates over the names of the efficacy types and checks if the length of the efficacy values for each type is greater than 1. If so, it selects the efficacy value based on the provided seed. Otherwise, it assigns the single efficacy value to the list. The function finally returns the list of sampled efficacies.

Examples

if (FALSE) { # \dontrun{
object <- list(efficacies = list(mab_vhr = c(0.1, 0.2), mab_mass = 0.3, lav_mass = c(0.4, 0.5), mat_mass = 0.6))
seed <- 1
get_efficacies_sample(object, seed)
} # }