列“x”、“left”和“right”是
list
每个元素长度大于1的列,但是
between
unnest
使
列表
pmap
params %>%
mutate(x = pmap(., rbinom)) %>%
select(-n) %>%
mutate(left = map2(x, size, ~
binom.agresti.coull(.x, .y)$lower),
right = map2(x,size, ~
binom.agresti.coull(.x,.y)$upper)) %>%
unnest %>%
mutate(coverage = pmap_lgl(list(x, left, right), between))
之间
结构
params %>%
mutate(x = pmap(., rbinom)) %>%
select(-n) %>%
mutate(left = map2(x, size, ~
binom.agresti.coull(.x, .y)$lower),
right = map2(x,size, ~
binom.agresti.coull(.x,.y)$upper),
coverage = pmap(list(x, left, right), ~ ..1 > ..2 & ..1 < ..3)