Hello in this section we're going to learn how to build some of the most important charts in our using
the package.
DZIEDZIC plot two.
And now in this letter we learn how to create a histogram with Judy plot to add the database.
We are going to use the same deal more which presents information about a group of car owners and we
are going to build the histogram for the variable income OK first of all we have to load the package
DZIEDZIC plot too.
So please don't forget that.
OK and now let's build our histogram as the center of the Gigia plot function is very simple on the
y axis we would represent the counts the absolute frequencies and he or them in their search function
g here.
GRAHAM We have to specify the following The days of rain deal more data equal to the more.
And here under this option that X X stands for if that is we are going to specify only the x x is.
So on the x axis we are going to represent the income because the y axis on the vertical axis that the
program will represent the counts by default.
So that from there and here under the floor tab we have how we have our histogram for it as we can now.
Our distribution is pretty good right.
Qued so were the values that concentrated to be the last.
Now let's play around a bit with his program if we want to make it more good looking.
Let's change the color and the Vians border.
How to do that in the farm finger on his program.
We've had two options.
The options feel to rad.
So our Bharath will be filled with the rad and the option color with black.
So the beans will have a black border.
OK.
Let the lack there.
And right after that there is more good looking now.
OK.
We want to represent the density on the y axis.
I mean the relative frequency is the center is pretty much the same but we are in the affirmative action
function.
We have to enter the y axis and here with petrifies that on the y axes we represent the density we defend
tuks the way with all we have.
But two point four density and two point to that we're it.
As an artist here on the wire axis we don't have that count anymore but we have the data.
OK now let's great faith is greed multiple histograms we will create a histogram for each combination
of the variable gender and marital status for the same variable.
So let syntax.
First of all we specify all the options on the Jiwon histogram function.
OK.
So again we will represent the density on the y axis but now we put supplementary function face that
greed and here are our demands.
We put the ball grouping variable gender and marital status separated via Twitter.
So we are the program to create for histograms on the same panel.
OK.
Because gender has two categories.
Marital have also two categories married and are married.
So work with have but two we have four of them in all.
Let's see how we looking.
OK.
So please look here.
So here in this town that we have the histogram for marriage marriage female Yes here they are married.
The main subject here for the male marriage object and here for the married male subject is
OK.
And now let's see how to create multiple histograms.
But this time all the same charge we will build a histogram for each gender category male and female.
What do we have to add in the syntax here.
Under the aesthetics function a a as we had the options here.
So we take the oxygen from here and we move it here.
It that its function and the feel will be equal to gender.
So I indicate the program that I want to create to gram for both male and female.
And I want to color the bed differently depending by gender.
So please remember that now the up and feel is not here outside the static function but here inside
the function.
Ok let run this fall.
And you can notice here we have in the red the bends for the female group and in blue that being the
male group and oleaginous was added by default to the charge to the histogram.
Now that the real variable might be a factor like gender.
In our case if it's not a factor we should convert it into a factor using the factor function.
That's the histogram.
Thank you.