Re: [R] tapply() and using factor() on a factor

2009-10-16 Thread David Winsemius
it clearly doesn't. -- DW In other words, how do I take a subset which yields "a" as the only level for log2? Alex -Original Message----- From: William Dunlap [mailto:wdun...@tibco.com] Sent: Thursday, October 15, 2009 11:59 PM To: Alexander Peterhansl; r-help@r-project.org Subj

Re: [R] tapply() and using factor() on a factor

2009-10-16 Thread Alexander Peterhansl
quot; "e" "f" "g" "h" "i" "j" In other words, how do I take a subset which yields "a" as the only level for log2? Alex -Original Message- From: William Dunlap [mailto:wdun...@tibco.com] Sent: Thursday, October 1

Re: [R] tapply() and using factor() on a factor

2009-10-15 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Alexander > Peterhansl > Sent: Thursday, October 15, 2009 2:50 PM > To: r-help@r-project.org > Subject: [R] tapply() and using factor() on a

[R] tapply() and using factor() on a factor

2009-10-15 Thread Alexander Peterhansl
Dear List, Shouldn't result1 and result2 be equal in the following case? Note that log$RequestID is a factor. That is, is.factor(log$RequestID) yields TRUE. result1 <- tapply(log$Flag,factor(log$RequestID),sum) result2 <- tapply(log$Flag,log$RequestID,sum) Yet, when I summarize th