Skip to contents

Simulate inhalation rates

Usage

simulate_inhalation_rate(x, IR_params = NULL)

Arguments

x

numeric vector or list of numeric vectors containing ages.

IR_params

(optional) data frame with columns "age", "mean" and "sd". See details for more information.

Value

List of numeric vectors containing inhalation rates.

Details

The age column of the optional IR_params data frame should be in ascending order and represent the lower value of age groups for the corresponding mean and sd values. When not provided, the default values will come from Table 6.7 of EPA's 2011 Exposure Factors Handbook using the mean of male and female values.

Examples

# Single numeric vector
ages <- sample(1:100, 6, replace = TRUE)
simulate_inhalation_rate(ages)
#> [[1]]
#> [1] 0.2046680 0.3929628 0.2741236 0.4144657 0.1834227 0.1481085
#> 

# List of numeric vectors
ages <- list(
  sample(1:100, 5, replace = TRUE),
  sample(1:100, 3, replace = TRUE)
)
simulate_inhalation_rate(ages)
#> [[1]]
#> [1] 0.3070299 0.1927680 0.4853415 0.1862906 0.2294230
#> 
#> [[2]]
#> [1] 0.2134527 0.1646486 0.1889414
#> 

# Custom IR_params
IR_params <- data.frame("age" = c(0, 20, 50),
                        "mean" = c(0.5, 0.3, 0.2),
                        "sd" = c(0.1, 0.06, 0.03))
simulate_inhalation_rate(c(15, 30, 65), IR_params)
#> [[1]]
#> [1] 0.4370755 0.2056266 0.2311348
#>