[R] correlation matrix in Hmisc

Frank E Harrell Jr feh3k at spamcop.net
Fri Oct 17 16:47:10 CEST 2003


On Fri, 17 Oct 2003 16:36:47 +0200
Luca De Benedictis <debene at unimc.it> wrote:

> Dear all,
> I am trying to compute a  matrix of Pearson's `r' or Spearman's `rho' 
> rank correlation coefficients using rcorr (Hmisc) the following way:
> 
>  > mx<-rcorr(x, type="spearman")[1]

Instead of [1] use $r.  Or use the new cor() function builtin to R 1.8.

Frank

> 
> but then ...
> 
>  > is.matrix(mx)
> [1] FALSE
> 
> Even if  I use as.matrix the result is not better.
> What can I do?
> 
> Thank you all
> 
> Luca
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help


---
Frank E Harrell Jr    Professor and Chair            School of Medicine
                      Department of Biostatistics    Vanderbilt University




More information about the R-help mailing list