Replacing count by percentage in R
I have the following code :
mutate( bmi = Gewicht / (Körpergröße/100)^2 ) %%
filter( Lebensalter = 18 )%%
filter(!is.na(bmi))%%
group_by(Geschlecht, Ethnie)%%
filter(!is.na(Ratio))%%
mutate (Poor = Ratio 1.3)%%
mutate (Adipös= bmi=30)%%
filter(!is.na(Poor))%%
ggplot+
geom_histogram(aes( y= Poor, fill=Adipös), stat = count)+
facet_grid(Ethnie~Geschlecht)
How can I get the percentage for each true and false for poor and adipös? E.g. 20% of male poor African American are also Adipös (overweight)? So instead of the bars showing the count I would have the percentage.
Topic homework data-analysis data statistics r
Category Data Science