Stata Collapse in R [closed]

I need to translate a Stata collapse into R, which is summarizing different variables with different functions (mean and sum) at the same time. The original Stata code is: collapse (mean) age male black married num_child hv_child age_youngest child_4 child_5 grade spouse_emp spouse_workhours working unemp retired disabled student homemaker work_part hh_income wage_03 wage_03_alt year dataset…

Details