library(dplyr)
library(gapminder)
gapminder %>%
pairwise_cor(country, year, lifeExp)
gapminder %>%
pairwise_cor(country, year, lifeExp, sort = TRUE)
# United Nations voting data
if (require("unvotes", quietly = TRUE)) {
country_cors <- un_votes %>%
mutate(vote = as.numeric(vote)) %>%
pairwise_cor(country, rcid, vote, sort = TRUE)
}
Run the code above in your browser using DataLab