Learn R Programming

bhmbasket (version 0.9.5)

scaleRoundList: scaleRoundList

Description

This function applies scaling and rounding to each item of a list of numerics

Usage

scaleRoundList(list, scale_param = 1, round_digits = NULL)

Arguments

list

The list to which the scaling and rounding should be applied to.

scale_param

A numeric for the scaling of each item of the list, Default: `1`

round_digits

An integer for the number of digits. If `NULL`, no rounding will be applied, Default: `NULL`

Value

A list of scaled and rounded numerics

Examples

Run this code
# NOT RUN {
some_list <- as.list(runif(5))
scaleRoundList(some_list, scale_param = 100, round_digits = 2)

scenarios_list <- simulateScenarios(
  n_subjects_list     = list(c(10, 20, 30)),
  response_rates_list = list(c(0.1, 0.2, 0.3)),
  n_trials            = 10)

analyses_list <- performAnalyses(
  scenario_list       = scenarios_list,
  target_rates        = rep(0.5, 3),
  n_mcmc_iterations   = 100)

scaleRoundList(
  list         = getEstimates(analyses_list),
  scale_param  = 100,
  round_digits = 2)
# }

Run the code above in your browser using DataLab