On Wednesday, 21.03.2007 at 09:10 +0000, Dave Ewart wrote:

> However, the underlying problem that gave rise to the difficulty was as
> follows.  A colleague wishes to create a matrix, where one of the
> dimensions of the matrix is the result of the 'choose' function, i.e.
> 
>   mycols<-choose(11,6)
>   a_matrix<-matrix(0,nrow=11,ncol=mycols)
> 
> Clearly, 'ncol' casts mycols as as integer.  In this case, a_matrix has
> only 461 columns, not 462.

Ignore me, obviously one can simply do:

a_matrix<-matrix(0,nrow=11,ncol=round(mycols))

Thanks again,

Dave.
-- 
Dave Ewart
[EMAIL PROTECTED]
Computing Manager, Cancer Epidemiology Unit
Cancer Research UK / Oxford University
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016

Attachment: signature.asc
Description: Digital signature

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to