How can I create a correlation matrix in R?

后端 未结 5 773
情深已故
情深已故 2020-11-27 10:24

I have 92 set of data of same type.

I want to make a correlation matrix for any two combination possible.

i.e. I want a matrix of 92 x92.

such that e

5条回答
  •  情话喂你
    2020-11-27 10:53

    You could use 'corrplot' package.

    d <- data.frame(x1=rnorm(10),
                     x2=rnorm(10),
                     x3=rnorm(10))
    M <- cor(d) # get correlations
    
    library('corrplot') #package corrplot
    corrplot(M, method = "circle") #plot matrix
    

    enter image description here

    More information here: http://cran.r-project.org/web/packages/corrplot/vignettes/corrplot-intro.html

提交回复
热议问题