ggcorplot: Correlation matrix

Description Usage Arguments Author(s) See Also Examples

View source: R/ggcorplot.R

Description

Plots a correlation matrix

Usage

1
2
3
ggcorplot(cor.mat,data=NULL,lines=TRUE,line.method=c("lm","loess"),type="points",
		alpha=.25,main="auto",var_text_size=5,
		cor_text_limits=c(5,25),level=.05)

Arguments

cor.mat

a cor.matrix object to plot

data

the data.frame used to compute the correlation matrix

lines

Logical. Should regression lines be drawn.

type

type of plot. "points" or "bins"

line.method

Character. Type of regression line.

alpha

numeric. level of alpha transparency for the points.

main

Title of the plot. defaults to the method of cor.mat.

var_text_size

size of the diagonal variable names.

cor_text_limits

lower and upper bounds for the size of the correlation text.

level

the size of the test differentiated by text color.

Author(s)

Mike Lawrence and Ian Fellows

See Also

cor.matrix qscatter_array

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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)
## Not run: 

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')

}

## End(Not run)

Deducer documentation built on May 2, 2019, 8:35 a.m.

Related to ggcorplot in Deducer...