I am new to R and have to use it for a course at uni. My question is, I am aiming to make a bar chart like the one pictured. I want bins of income at the bottom, with two bars for each bin representing the number of "Yes" and number of "No". I'll provide pictures of what I have done so far (with the desired result bottom right), but have been stuck for the past couple hours at this point. (so, for example, how do I find number of yes's within the first bin, which is between 1000 and 5800) (and then if possible how would I recreate this bar plot with my figures). Thanks heaps everyone!
1st 5 Rows of dataset directly relating to question MonthlyIncome Attrition 1 1081 Yes 2 1232 No 3 1261 Yes 4 1420 Yes 5 1483 No