How do I draw a bar chart based on two groups in R




I am trying to see the count of data points by age-group and then by gender within each age group.How do I do this in R.
I know it can be done by mosaic plot but I want the output to be like if we had done the same thing in excel.
Can somebody help me in this case??


Another related question was shared. Have a look at it!