Simulate external exposure
Value
list of matrices containing inhalation rates. Matrix columns are
named using the values in the expos_label
column for more than one data
frame row. Columns are sorted to have consistent order across functions.
Examples
# Single data frame
x <- data.frame(mean = 1:3, sd = (1:3) / 10, casn = letters[1:3])
simulate_exposure(x, n = 5)
#> [[1]]
#> a b c
#> [1,] 0.9589639 1.942589 2.451133
#> [2,] 0.8855310 2.023900 2.695203
#> [3,] 1.1057684 2.063064 2.496449
#> [4,] 1.2500731 2.162863 3.524906
#> [5,] 0.8554196 2.259877 3.247982
#>
# List of 2 data frames
y <- data.frame(mean = 4:6, sd = 0.1, casn = letters[1:3])
simulate_exposure(list(loc1 = x, loc2 = y), n = 5)
#> $loc1
#> a b c
#> [1,] 0.9985420 2.418962 2.889693
#> [2,] 1.0071619 1.904265 2.958021
#> [3,] 0.9372769 1.914698 3.174726
#> [4,] 0.9754153 2.018951 3.189433
#> [5,] 1.1182927 1.871831 2.871555
#>
#> $loc2
#> a b c
#> [1,] 3.949621 5.048086 6.059213
#> [2,] 3.949047 5.009067 5.847476
#> [3,] 3.938871 4.883739 5.957730
#> [4,] 4.050804 5.091922 5.960801
#> [5,] 4.057940 5.047837 6.006035
#>
# Input has custom column names
z <- data.frame(ave = 1:3, stdev = (1:3) / 10, chnm = letters[1:3])
simulate_exposure(z,
expos_mean = "ave",
expos_sd = "stdev",
expos_label = "chnm",
n = 5)
#> [[1]]
#> a b c
#> [1,] 1.0068706 2.246875 2.465981
#> [2,] 1.1088794 2.286902 2.671737
#> [3,] 0.9603815 2.013617 3.227719
#> [4,] 0.9356854 2.088608 2.733121
#> [5,] 1.0065421 2.397329 2.783188
#>