I would expect that when calculating get_p_value(direction = both) would be equal to adding up the tails, i.e., summing up the get_p_value when the direction is "greater" than the observed value and get_p_value when the direction is "less" than the (negative of the) observed value. But it turns out that this doesn't quite work.

Here's my code below. You can see that the p-value for the right tail is 0.284 whereas the p-value for the left tail is 0.294. But when calculating both, we get a p-value that is 0.568, which is twice the right tail rather than adding up both tails. What gives?

```
set.seed(123)
df <- tribble(~group, ~value,
0, 1,
0, 1,
0, 1,
0, 1,
0, 0,
0, 0,
1, 0,
1, 0,
1, 0,
1, 0,
1, 1,
1, 1) |>
mutate(group = as.factor(group))
observed_diff <- df %>%
specify(value ~ group) %>%
calculate("diff in means", order = c("0", "1")) |>
pull(stat)
diff.under.null <- df |>
specify(value ~ group) |>
hypothesize(null = "independence") %>%
generate(reps = 1000, type = "permute") %>%
calculate("diff in means", order = c("0", "1"))
diff.under.null |>
get_p_value(
obs_stat = observed_diff,
direction = "greater") |> pull(p_value)
#> [1] 0.284
diff.under.null |>
get_p_value(
obs_stat = - observed_diff,
direction = "less") |> pull(p_value)
#> [1] 0.294
diff.under.null |>
get_p_value(
obs_stat = observed_diff,
direction = "both") |> pull(p_value)
#> [1] 0.568
# 0.284 + 0.294
```