This is my input data:
Program = c("A","A","A","B","B","C")
Age = c(10,30,30,12,32,53)
Gender = c("F","F","M","M","M","F")
Language = c("Eng","Eng","Kor","Kor","Other","Other")
df = data.frame(Program,Age,Gender,Language)
I would like to output a table like this:
Program | MEAN AGE | ENG | KOR | FEMALE | MALE |
---|---|---|---|---|---|
A | |||||
B | |||||
C |
Where MEAN AGE is the average age, ENG,KOR,FEMALE,MALE are counts.
I have tried using dplyr and t() but in this case I feel like I'm completely lost as to what are the steps (my first post, new to this). Thank you in advance!