[R] cor.test() -- how to get the value of a coefficient

Erik Iverson eriki at ccbr.umn.edu
Tue Jun 8 22:53:27 CEST 2010



Ekaterina Pek wrote:
> Hi, all.
> 
> Yet another beginner to R : )
> 
> I wonder, how it's possible to get the value of a coefficient from the
> object produced by cor.test() ?
> 
>> cor.test(a, b, method="spearman")
> 
You can always assign the value of a function to a variable, and then 
use ?str to see the structure of that object.

x <- cor.test(a, b, method = "spearman")

str(x)



More information about the R-help mailing list