Is the following what you want?

> x<- rnorm(800)
> xt <- x[1:2^trunc(log(length(x),base=2))]
> length(xt)
[1] 512

HTH,
Andy

> -----Original Message-----
> From: Poizot Emmanuel [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 14, 2003 4:52 AM
> To: [EMAIL PROTECTED]
> Subject: [R] Change array size
> 
> 
> Hi,
> I would like to know if there is a way to change a vector of 
> arbitrary size
> to make it fits the nearest upper size multiple of a power of 2.
> 
> -- 
> Cordialy
> ----------------------------------------
> Emmanuel POIZOT
> Cnam/Intechmer
> Digue de Collignon
> 50110 Tourlaville
> T�l : (33)(0)2 33 88 73 42
> Fax : (33)(0)2 33 88 73 39
> -----------------------------------------
> 
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 


------------------------------------------------------------------------------

______________________________________________
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to