‫Now let us learn how to create a histogram in our Instagram in R is created using a command at USD est.
‫Let us look at the customer data once again
‫in this data.
‫The Age variable as numeric values.
‫If you want to see the distribution of this age variable or different age categories you want to first
‫create the categories of this age and against each category.
‫You want to get the count of customers who belong to that category.
‫Instagram is the blog which gives us this value.
‫Same as bad blog.
‫The height of the bars in a histogram will give us the frequency of each category coming in our data.
‫So let us create the histogram for this.
‫Each variable we will write history and within bracket specify these very well so it belongs to customer
‫data
‫dollar and intellect age but underscore mine.
‫Instagram comes on the bottom side.
‫It gives us the frequency of each category of age which art has created on its own.
‫It has created eleven bucket by default and assigned the frequency to each category.
‫Now if you want to create a different bucket so if you want only five bucket you can change this by
‫using the barometer called breaks to within Instagram will again mention customer dollar age karma
‫Biggs is equal to fame
‫you can see this has now six bars we told it to have five but so the number five that we gave it is
‫a suggestive number.
‫It does not chart that out will create only five bars I can create more than five or less than five
‫bars also.
‫So in that case it has created six bars.
‫But if you want around five bars you have suggested using the breaks parameter.
‫There are other ways of suggesting the categories.
‫So if you do not want it to start from 10 and have a word of 10 to 20 then 230 you can give the weight
‫of these categories to specify the words we will rate.
‫Let us copy paste command.
‫And after breaks we will see and within bracket we will write these values.
‫So we wanted to be from zero to 40 40 to 60 and 60 200.
‫So basically I am categorizing my customers or belong to young middle aged and aged customers.
‫So these three categories will be created divide on this.
‫So now we have zero to 40 40 to 60 60 two hundred.
‫Notice that when we ran this command out has automatically taken the frequency identity on the different
‫side which means if you take out the area of this chart it will give you the frequency of customers
‫belonging to each category.
‫We do not want it to be like this.
‫So we will need another parameter which is what frequency and which we write as if on cue
‫is equal good.
‫True.
‫So this will give us frequencies only.
‫Now you can see most of the customers belong to 0 to 40 age group and least belong to 60 200 age group.
‫Again as we discussed in bar plot you can change the color of this distribution although you can copy
‫paste this line and will add the parameter of color which is.
‫See you.
‫L
‫is equal to let's call it blue
‫and this command.
‫You can see this now has blue color.
‫If you want to change the name of this chart you can use the main parameter too.
‫Right now it has a heading which just took it out of customer dollar age.
‫That is the variable that we had.
‫You may not want this in a presentation to the histogram of age.
‫If we'd done this the main heading is updated.
‫We can also change the x label for this Instagram just in the same way we discussed what about plot
‫the parameters for this will be X Lab.
‫We are not doing this.
‫Once this Instagram is created you can export this into an image file or I believe and use it in your
‫presentation to do that.
‫There is this export option in our studio or you can revisit debug laws selected in that we told you
‫the command to run to create a BMG file.