This that show we're going to learn how to build column charts with Ju-Ju plot to we are going to use
the days I-frame frame D-Mo. that contains information about a sample of car owners and we are going
to create a column chart representing the average income for each education levels.
OK.
First of all let's load the package Dugit plot two.
And now let's write the Gigia plot function to build the chart as a center is now bit different from
the previous last one.
Here in the plot function we must define our data I-frame dream on.
And to the aesthetics of a eat ass.
So the variable x will represent the application of that all with five categories the variable y would
represent the average income.
And here we add the option feel equal to the variable you do education indication indicate in the program
that we want to color each B in each column differently depending.
By the variable education level.
So each educational level will have a different color column and then very important we have to add
to this fine science test summary and define the function that we want to use on the wife column.
First of all and this Fontanes me and so we want that each column represent the average income the meaning
and then we said they are angio am geometry to bar in the program that we want or call them charge
OK.
So that's from Dave
so here it is chart we have the average income for each education level.
And here in the legend we have the color for each for each education category college degree with the
Rad's did not complete high school with green etc..
Now if you want the same color for the columns for the B.
What do they have to do.
You'll have to move the field from the DZIEDZIC plus function to the test summary function.
So here and you have to indicate a color preference for this option.
For example here I want to color all the columns we interact.
So please remember that the feel option is not here in the G.G. plot function but here is a summary
function that run this.
OK.
As you can notice all the columns are colored in the right place.
Now that is the grouping variable.
In our case the educational level is not a factor.
You must convert it into a factor using the factor function.
Now let's see how to create a plastered bar chart by the variable genders so the grouping variable the
clustering variable will be gender.
In this case and let's pull the columns side by side using the option function.
Now the the option position dodge.
OK so the syntax is the same.
But here is a test summary function.
We have to add the value for the position option and that is position dodge that's run it.
That said so here that the rabs columns correspond to the female the group and the blue color the blue
columns correspond to the male group.
And of course all the columns represent again the average income for each category of education but
separately for male and female subject.
Now in order to stack the columns we can use the value positions to tack for the option position.
So here as an artist we have positions stack instead of position.
Dodge the last round is ok.
I think that this chart does not need many explanations.
That is for the column charts.
Thank you.