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, 2022 in Data Analytics by Avinash
• 1,260 points
531 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, 2022 by Sohail
• 3,040 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, 2022 in Data Analytics by avinash
• 1,840 points
473 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,670 points
6,209 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
1,002 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
763 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,700 points
809 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, 2022 in Machine Learning by Dev
• 6,000 points
1,009 views
0 votes
1 answer
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, 2022 in Data Analytics by Avinash
• 1,260 points
339 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, 2022 in Data Analytics by Sohail
• 3,040 points
641 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, 2022 in Data Analytics by Sohail
• 3,040 points
423 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP