Last answered:

11 Nov 2022

Posted on:

10 Nov 2022

0

count = n() statement

Hello, I'd like to ask what is the purpose of count= n() statement in that(time: 1.23) filtering operation? Thank you from now.

1 answers ( 0 marked as helpful)
Instructor
Posted on:

11 Nov 2022

0

Hi incinur,
thanks for reaching out! The n() returns the number of observations we have in the group. So, when we say count= n() we are asking for the number of observations in each group. As we're grouping by species, the second column count shows us the number of observations in the data which belong to the group. At the end of the statement we also add a condition for count > 1, so we only see the species, which have at least two members.
Hope this helps!

Best,
365 Eli

Submit an answer