How can I create a correlation matrix in R

0 votes
I have 92 sets of data that are all of the same type.

I'd want to create a correlation matrix for any two feasible pairings.

I need a 92x92 matrix, for example.

such that element (ci,cj) is a relationship between ci and cj.

How can I go about doing that?
Jun 14 in Data Analytics by Avinash
• 1,260 points
14 views

1 answer to this question.

0 votes

An example,

 d <- data.frame(x1=rnorm(10),
                 x2=rnorm(10),
                 x3=rnorm(10))
cor(d) # get correlations (returns matrix)

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
answered Jun 14 by Sohail
• 2,960 points

Related Questions In Data Analytics

0 votes
0 answers

How can I avoid the transformation into an atomic vector in a matrix (r programming)

I'm scrambling to come up with a ...READ MORE

Jul 5 in Data Analytics by avinash
• 1,840 points
7 views
0 votes
1 answer

How can I delete multiple values from a vector in R?

The %in% operator tells  which elements are ...READ MORE

answered Apr 27, 2018 in Data Analytics by shams
• 3,660 points
5,417 views
0 votes
1 answer

How can I select a CRAN mirror in R ?

There are many ways of doing so ...READ MORE

answered May 9, 2018 in Data Analytics by zombie
• 3,790 points
321 views
0 votes
1 answer

How can I read a .csv file in R language?

read.csv () function is used to read ...READ MORE

answered Jun 12, 2018 in Data Analytics by zombie
• 3,790 points
296 views
0 votes
1 answer

Modular programming in R language

R provides support to create subscripts. For ex. ...READ MORE

answered Jan 31, 2019 in Data Analytics by Tyrion anex
• 8,690 points
286 views
0 votes
1 answer

Plotting logistic regression in R with the Smarket dataset

The first, third, and fourth methods of ...READ MORE

answered Apr 12 in Machine Learning by Dev
• 6,000 points
67 views
0 votes
0 answers
0 votes
0 answers

How to generate correlation plot of my data.frame in R?

I have a df and I want ...READ MORE

Jun 9 in Data Analytics by Avinash
• 1,260 points
15 views
0 votes
1 answer

How can I make a list of lists in R?

Lists of lists are simple to create. list1 ...READ MORE

answered Jun 24 in Data Analytics by Sohail
• 2,960 points
11 views
0 votes
1 answer

How to rename a single column in a data.frame?

data.rename(columns={'gdp':'log(gdp)'}, inplace=True) The rename show that it accepts a dict ...READ MORE

answered Jun 24 in Data Analytics by Sohail
• 2,960 points
21 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP