[R] behavior of "by"
Sebastian P. Luque
spluque at gmail.com
Wed Oct 29 02:39:12 CET 2008
On Tue, 28 Oct 2008 18:04:57 -0700,
Jeff Laake <Jeff.Laake at noaa.gov> wrote:
> Any insight into the behavior of "by" in the following case would be
> appreciated. There is a note in the help details for "by" about
> documenting behavior since v2.7 but I don't entirely understand what
> it is saying. I'm using R2.7.2 Windows. I'm interested if the
> following behavior was a change or whether it has always worked this
> way. I looked at RSiteSearch and read through version changes but
> found nothing.
> Take a dataframe as follows:
>> samples
> Region.Label Area Sample.Label Effort Label 1 1 10000 1 100 11 2 1
> 10000 2 100 12 3 1 10000 3 100 13 4 1 10000 4 100 14 5 1 10000 5 100
> 15 6 1 10000 6 100 16 7 1 10000 7 100 17 8 1 10000 8 100 18 9 1 10000
> 9 100 19 10 1 10000 10 100 110
I cannot reproduce your results (please provide reproducible code), but:
table(samples$Region.Label)
is simpler for this purpose.
--
Seb
More information about the R-help
mailing list