group by average in R : <p>I have data structure (data frame), which contains 3 column, age (integer), weight (float) and height (float), I want to calculate average and median weight/height in each age group (e.g. average weight/height in age 10, average weight/height in age 11, average weight/height in age 12, etc.). Wondering if there are any reference code examples?</p>

<p>Currently, I am doing group-by alike function outside R using Python numpy/pandas package. If there is R built-in solution for group-by, it will be great.</p>

<p>regards,
Lin</p>
