0

I'm trying to apply a function I created. It selects the first five lines of an object. I want to apply it for all the levels of a factor of my data frame.

As a result, I want my data frame with only the first five lines selected in each level of the factor I selected.

Does someone knows how to help me? It seems to be simple, but I can't find the solution.

  • 1
    You'll get much more help if you provide a [Reproducible Example](https://stackoverflow.com/a/5963610/10442423). – Daniel O Mar 30 '20 at 14:06
  • Does [this](https://stackoverflow.com/questions/50105023/applying-a-function-to-different-levels-of-a-factor-in-r) help? –  Mar 30 '20 at 14:07

0 Answers0