R dataframe: How to slpit by 2 colums and calculate the mean : I have a dataframe with several columns like that: (I ha ve lots of columns from which I want to calculate the mean, so I cannot adress them by name)

    df:
      A    B    C     D     E     F....
      1    1    10    ...   ...   ...
      1    1    30    ...   ...   ...
      1    2    100   ...   ...   ...
      1    2    300   ...   ...   ...
      2    1    4     ...   ...   ...
      2    1    6     ...   ...   ...
      2    1    8     ...   ...   ...


Now I want to split this dataFrame into Groups of A and B and calculate the mean like that:

    A=1:
        B=1: mean = 20
        B=2: mean = 200
    A=2:
        B=1: mean = 6

How would I do that ?

Thank you!