I have a regional dataset and I have to analyze it in the R language. I have to provide the recommendations where can an organization promotes their programs. I want to find a correlation between 25 attributes. can anybody help me out with this?
Asked
Active
Viewed 68 times
1 Answers
1
We can just use cor
to get the correlation between the columns
out <- cor(df1)
data
set.seed(24)
df1 <- as.data.frame(matrix(rnorm(25), 5, 5))

akrun
- 874,273
- 37
- 540
- 662
-
I have 24 numeric attributes and 1 attribute is character, so how i deal with it? – Ronak Patel Sep 23 '18 at 21:59
-
@RonakPatel Just subset the numeric columns and apply the `cor` `i1 <- sapply(df1, is.numeric); cor(df1[i1])` – akrun Sep 23 '18 at 22:02