[R] correlation among variables in the same subset

R. Michael Weylandt michael.weylandt at gmail.com
Wed May 16 16:11:53 CEST 2012


? cor

e.g.,

x <- data.frame(rnorm(5), rnorm(5), rnorm(5), rnorm(5), rnorm(5))

cor(x)

Best,
Michael

On Wed, May 16, 2012 at 6:52 AM, Andrea Sica <aerdna.sica at gmail.com> wrote:
> Dear all,
>
> I have created a subset from my dataset, which contains 6 variables.
> I need to make the correlation among all of them, possibly, without
> making it one by one. Is there any command that can permits me to
> do it directly for all of them in the same time?
>
> Thank you so much in advance.
>
> Andrea
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list