-
Notifications
You must be signed in to change notification settings - Fork 45
Description
I'm having a problem with the legend of my plot because of the structure of my data. In the results of my mantel test, I don't have p-values between 0.01 and 0.05. When I use qcorrplot, the Mantel's p doesn't show the 0.01-0.05 category. Is there a way to force this function to display that category in the legend even though my values don't fall in it?
For example, I'd run into the problem if the results of my mantel test looked something like this:
env <- c("var1", "var2", "var3", "var4")
r <- c(0.322, 0.175, 0.298, 0.0763)
p <- c(0.001, 0.004, 0.001, 0.135)
mantel <- cbind.data.frame(env, r, p)
mantel %>%
mutate(rd = cut(r, breaks = c(-Inf, 0.2, 0.4, Inf),
labels = c("< 0.2", "0.2 - 0.4", ">= 0.4")),
pd = cut(p, breaks = c(-Inf, 0.01, 0.05, Inf),
labels = c("< 0.01", "0.01 - 0.05", ">= 0.05"))) -> mantel
Is there a way to force geom_couple() to show p and r values in the legend that aren't in the data?
Here's an example of what happens with my real data, where I'm missing 0.01-0.05 in the p legend and >0.4 in the r legend: