Skip to content
Prev 79596 / 398502 Next

selecting every nth item in the data

On 25 Oct 2005 at 13:48, Stephen Choularton wrote:
From:           	"Stephen Choularton" <mail at bymouth.com>
To:             	"R Help" <r-help at stat.math.ethz.ch>
Date sent:      	Tue, 25 Oct 2005 13:48:42 +1000
Subject:        	[R] selecting every nth item in the data
As glm accept subet you probably can use

test<-seq(1,4000,n)

glm(...., subset = test)

to select only n'th item or

glm(...., subset = -test)

to select all but n'th items.

or you can split the data freme by

mydf[test,] or mydf[-test,]

HTH
Petr
Petr Pikal
petr.pikal at precheza.cz