The aggregate function

Hello ! I don't understand the fonction aggregate and really need your help !

I have a table with three columns : "distance", "specie", "number".

We are supposed to use aggregate to find the mean of "number" for each different "specie" at each different "distance".

I tried so many things I start believing our teacher forgot to give us another hint !
Thanks for reading :slight_smile:

Hi @SF_Crisis! Since your question seems related to an educational assigment, I'll try to avoid providing you a complete solution, but rather a hint:

The aggregate function has an argument (by) that takes the values of the variable you are using to group the data. These values have to be provided as a list (for example, by = list(grouping_variable)). You may find some additional help here.

I hope you find this a bit useful. :slight_smile:
Good luck!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.