I am using ggpairs() to create scatterplots and correlations for a set of variables. The text on my correlation plots don't fit onto the plot area, as they are horizontally adjusted to end halfway through the plot. I saw on another post how to adjust the topline correlation text, but it didn't work for the group correlations.
Here's an example:
n = 1000
test_results = tibble(
test1=sample(1:10, n, replace=TRUE),
test2=sample(1:10, n, replace=TRUE),
test3=sample(1:10, n, replace=TRUE),
test4=sample(1:10, n, replace=TRUE),
test5=sample(1:10, n, replace=TRUE),
political=sample(c("Democrat", "Republican", "Green", "Libertarian"), n, replace=TRUE))
test_results %>%
select(test1, test2, test3, test4, test5, political) %>%
ggpairs(columns=c(1:5), mapping = aes(color = political, alpha=.5),
upper = list(continuous = wrap("cor", size = 3, hjust=0))
)