Hello. I have a data set that has the following structure.

hhcode member_id age
1 1 45
1 2 23
1 3 31
2 1 50
2 2 38
2 3 31
2 4 14
3 1 65
3 2 31
3 3 15

I want to make it as follows.

hhcode age_1 age_2 age_3 age_4
1 45 23 31 .
2 50 38 31 14
3 65 31 15 .


Thank you.