Re: [R] Selecting variables from a data.frame

About this list Date view Thread view Subject view Author view Attachment view

From: Laurent Gautier (laurent@cbs.dtu.dk)
Date: Tue 31 Dec 2002 - 13:38:41 EST


Message-id: <20021231023841.GC211294544@genome.cbs.dtu.dk>

On Tue, Dec 31, 2002 at 02:33:37AM +0100, Till Baumgaertel wrote:
>
> My question: which is the most elegant way to select the desired variables?
>
>
> Or in general: I'd like to select 2^m variables starting with the n-th variable
> of the original set with a distinct distance d. If m==3, n==5 and d==3 this
> should get me the following variables:
> 5, 8, 11, 14, 17, 20, 23, 26

seq(n, n + d * (2^m - 1), by=d)

seems to generate the index vector you want

Hopin' it helps,

Laurent

______________________________________________
R-help@stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jun 2004 - 09:32:00 EST