I want to apply a function to each combination of two lists elements.
library(tidyverse)
map(
.x = c(0, 1)
, .f = function(x) {
qnorm(p = 0.05, mean = x, sd = 1, lower.tail = FALSE)
}
)
[[1]]
[1] 1.644854
[[2]]
[1] 2.644854
map(
.x = c(0, 1)
, .f = function(x) {
qnorm(p = 0.05, mean = x, sd = 2, lower.tail = FALSE)
}
)
[[1]]
[1] 3.289707
[[2]]
[1] 4.289707
Now trying to combine both in one (not getting required output anyhow).
map2(
.x = c(0, 1)
, .y = c(1, 2)
, .f = function(x, y) {
qnorm(p = 0.05, mean = x, sd = y, lower.tail = FALSE)
}
)
[[1]]
[1] 1.644854
[[2]]
[1] 4.289707
Wondering how to get output for all four combinations?