Skip to content
Prev 138440 / 398506 Next

subsetting a dataframe

On 3/4/2008 8:41 AM, John Sorkin wrote:
I would do that in the following way:

ShortLavin <- subset(Lavin, Site %in% c("PP","CC","FH"))
Of course, you could have done the subsetting within the call to glm:

fit1poisson <- glm(NumUniqOpPt~Seq+Site,family=poisson(link = "log"),
data=subset(Lavin, Site %in% c("PP","CC","FH")),
offset=log(NumUniqPt))
Minus127 <- subset(ShortLavin, !rownames(ShortLavin) %in% 127)