mns to count
> (val1 and val2)?
>
>
> Betreff: Re: [R] Count values in a dataframe with respect to groups
>
> Try this:
>
> aggregate(val ~ grp, dta, length)
>
> On Fri, Oct 8, 2010 at 11:28 AM, Marcus Drescher wrote:
> Dear all,
>
> I am looking for a fun
alifornia, USA
- Original Message
> From: Marcus Drescher
> To: "r-help@r-project.org"
> Sent: Fri, October 8, 2010 8:04:40 AM
> Subject: Re: [R] Count values in a dataframe with respect to groups
>
> Thanks! It works great.
>
> One more question: how would I have
Have a look at table
table(na.omit(dta)$grp)
Untested!
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium
Research Institute for Natur
I am sorry for the typo, it is about counting two columns an skipping the NAs.
How would I have to set the formula if I would have two columns to count (val1
and val2)?
Betreff: Re: [R] Count values in a dataframe with respect to groups
Try this:
aggregate(val ~ grp, dta, length)
On Fri
Thanks! It works great.
One more question: how would I have to set the formula if I would have the
columns to count (val1 and val2)?
Betreff: Re: [R] Count values in a dataframe with respect to groups
Try this:
aggregate(val ~ grp, dta, length)
On Fri, Oct 8, 2010 at 11:28 AM, Marcus
Try this:
aggregate(val ~ grp, dta, length)
On Fri, Oct 8, 2010 at 11:28 AM, Marcus Drescher wrote:
> Dear all,
>
> I am looking for a function to count values belonging to a class within a
> dataframe (and ignore NAs).
>
> grp = c(1,1,1, 1,2, 2,2)
> val = c(2,1,5,NA,3,NA,1)
>
> dta = data.fra
6 matches
Mail list logo