For example, if we calculate Pearson correlation and P-value of first two variables of data set mtcars, results are something like this:
Correlation value:
mpg disp
mpg 1.00 -0.85
disp -0.85 1.00
P-value:
mpg disp
mpg 0.0000 0.0000
disp 0.0000 0.0000
Instead of this, Is there any way to have results like this:
Corr. p-value
mp mp 1.00 0.0000
mp dip -0.85 0.0000
I have more than 200 variable and want to generate results like this and then write those results on CSV using write.csv command. Thank you!