data(mtcars)
corr.mat1<-cor.matrix(variables=d(mpg,carb,carb+rnorm(length(carb))),,
data=mtcars,
test=cor.test,
method='spearman',
alternative="two.sided",exact=FALSE)
p<-ggcorplot(corr.mat1,data = mtcars)
print(p)
if (FALSE) {
has.hex<-require("hexbin")
if(has.hex){
data(diamonds)
corr.mat<-cor.matrix(variables=d(price,carat,color),,
data=diamonds,
test=cor.test,
method='spearman',
alternative="two.sided")
p1 <- ggcorplot(cor.mat=corr.mat,data=diamonds,type="bins",
cor_text_limits=c(5,15),
lines=FALSE)
print(p1)
rm('corr.mat')
}
}
Run the code above in your browser using DataLab