[R] Stats package

Sean Davis sdavis2 at mail.nih.gov
Thu May 27 12:48:07 CEST 2004


Jason,

If you have a matrix m, you can take

cor(t(m))

Where t is the transpose operator.

Sean

On 5/27/04 6:34 AM, "Jason Skelton" <jps at sanger.ac.uk> wrote:

> 
> Hi
> 
> The cor function in the stats package calculates the correlation between
> columns of data, does anyone know if it is at all possible to calculate
> the correlation between rows instead ?
> Or is there an appropriate package or function that is more appropriate
> I'd like to calculate spearman & pearson correlations between rows.
> 
> Many thanks
> 
> Jason
> 
>




More information about the R-help mailing list