[R] Combine vectors in order to form matrixes with combn

Moreno Mancosu nomero at tiscali.it
Mon Sep 21 16:19:17 CEST 2009


Hello!

I've a problem with the combn function and a set of vector. I 
would like to make a simple combination where, instead of scalars, i 
would like to combine vector, in order to form matrixes.
In other 
words, i have nineteen 6-items vectors (for example coef1-coef19), that 
i would like to combine in n!/k!(n-k)! 6x6 matrixes.

I tried with a 
code like this

mma <- combn(c(coeff1,coeff2,...,coeff19),function(x)
matrix(x,6,6))

but i think that R doesn't recognize that these are not 
scalars. In fact the error is:

Errore in matrix(r, nrow = len.r, ncol 
= count) :
  invalid 'ncol' value (too large or NA)
Inoltre: Warning 
message:
In combn(c(coeff1, coeff2, coeff3, coeff4, coeff5, coeff6, 
coeff7,  :
  si è prodotto un NA per coercizione


Some ideas?

Thanks 
in advance,

Moreno


Tutto Incluso Light: chiami e navighi senza limiti a soli 9,95 euro al mese. Gratis la Sim Tiscali Mobile con 25 euro di traffico! ATTIVA ORA

http://abbonati.tiscali.it/telefono-adsl/prodotti/tc/tuttoincluso_light/




More information about the R-help mailing list