I'm learning to use R, and I want to do an analysis of my customers and the distribution of them into categories. This is an example of my data:
I want to know how many customers (cards) have tickets in A, B or C, and the amount spend on each of these categories, and then do the same thing but for each type of segment.
I want to do a bar chart with the percentage of tickets in each category of all my customers and then 3 charts of each segment.
Heres an example of what I want to get:
The thing is that there are cards that have 0 tickets on that category. I've been thinking that it might work to add a column beside each category, adding for example an "if the row has tickets in category A", then put A in that row, so maybe its easier to create a column?
If you think that might work, how could I run that? Sorry but I'm very new on R and I have a huge data base :(
Thanks for your help!!