[R] Multiple operations on list

Wolski wolski at molgen.mpg.de
Mon Sep 20 19:36:22 CEST 2004


Not sure if I got your point. 
But if it is to compute apply a function
to all pairs (x1,x2);(x1,x3);(x2,x3) where x1,x2,x3 are stored in a list you can take look at the sources 
of  function listdist which computes an object of class dist from a list, in the package "pairseqsim" available from bioconducor, to get an idea how to do this.


*********** REPLY SEPARATOR  ***********

On 20.09.2004 at 13:24 Stephane DRAY wrote:

>suppose I have a list with matrices:
>I want to compute for all combination of xi and xj (x1,x2 x1,x3 and x2,x3) 
>a value.
>This value is given for the pair x1,x2 by trace(x1%*%t(x1)%*%x2%*%t(x2)) / 
>I know that product matrices t(xi)%*%xi can be obtained by:
>but I do not know how to "mix" the values in aa to obtain the desired
>Is there a way to do it without for loop ?
>Thanks in advances,
>Stéphane DRAY
>Département des Sciences Biologiques
>Université de Montréal, C.P. 6128, succursale centre-ville
>Montréal, Québec H3C 3J7, Canada
>Tel : (514) 343-6111 poste 1233         Fax : (514) 343-2293
>E-mail : stephane.dray at umontreal.ca
>R-help at stat.math.ethz.ch mailing list
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

More information about the R-help mailing list