‫Now we have customer and product data loaded in our workspace.
‫Let us look at the customer data plans to do this.
‫We will run this command new customer.
‫You can see in the first column there is a unique customer data.
‫Then there is customer name segment.
‫And so on.
‫And the last column is region.
‫This table lists down all the customers.
‫If you want to get the aggregate of customers in each region.
‫What this means is if you want to find out the number of customers belonging to each region we will
‫create a table which will have regions and against each region.
‫It will have count of customers this is called Creating the frequency distribution of a particular variable.
‫From this data we will find out the frequency of occurrence of each region.
‫So how many times sold comes in this column How many times list comes in this column and so on.
‫So let us go and run a query to find out this frequency distribution for region variable to do this.
‫We will run.
‫Why get
‫Will
‫and within this we will maintain the data which is customer
‫and offer dollar sign will mentioned the variable which is region.
‫You can know that we are navigating using the arrow keys and pressing tab to select the particular option.
‫If I run this command there will be a variable called VI created here.
‫It is a table.
‫It has four values for the four different regions that we had in our data.
‫Let us look at this via data ones will just fade away and present it
‫you can see it has four values for each for four different regions central east south and west central
‫comes one eighty four times East comes to twenty times and its outcomes 134 times in our data
‫if you want to look at in a proper table format you can use the view command view why have you done
‫this you can look at it in a proper table format we'll go back once we have this data we can create
‫by the plot on this but lots of graphical representation of frequency distributions it will have colored
‫bars the height of these bars we really note the value of that particular variable so when we have categorical
‫variables that is we have categories such as central east south and west we can collect t frequencies
‫into a frequency distribution this will give us the number of times that particular categories appearing
‫in our data and that frequency distribution can then be plotted in the form of a bar plot let us create
‫this bottler.
‫And once desecrated will discuss it further to create a boatload on this data we'll just ride by the
‫plot
‫and write right here.
‫Control Center you can see in the right bottom window in this type of plot we have about plot these
‫forward are these regions and this axis gives us the frequency.
‫So central is somewhere around 170 if you look at this which is confirmed by the data it is 184 if you
‫look at the height of this table it is somewhere around 225 it is actually 220.
‫So basically the height of the bar is giving you the frequency of this particular category.
‫Now there are certain parameters of this bar plot command will add them one by one so that you understand
‫the importance of each of these parameters to these parameters basically are the properties of this
‫bar plot that we have created parameters include the color of this bar plot the orientation the boundaries
‫all those things.
‫So you can change these values.
‫So let us first arrange this bar plot in the order of these hate to do this we will raid bar plot
‫y square bracket order
‫black and white.
‫When we do control get on this you can see this is all done in deep ascending order.
‫If you want to arrange it in descending order you just put a minus sign in front of Wei
‫you can see that the PLA does now in descending order.
‫The second parameter that we will discuss is to change the orientation of bar blood.
‫So currently the bar does standing vertically.
‫If you want to change the orientation to horizontal so that the bars are shown horizontally to do that
‫we will ride bar block y within squared backward order with Y
‫comma actual RDA which is for horizontal is equal to to
‫run this command debug block.
‫There is no horizontal
‫next.
‫What we often like to do is change the color of this bar plot because this bar plug may not be looking
‫very good.
‫And if you want to use this bar plot in your in your presentation order in your research analysis you
‫may want to change the appearance of this bar plot so we will change the color of this bar Plot to Change
‫the color.
‫There is an additional parameter called Color C0 l.
‫You can also write color completely but see you l will alter do.
‫And if you want all the bars to be on the same color you just write that particular class name so you
‫can write red but then double quotation marks you put on this so you can see all the bar plots are now
‫in red color.
‫If you want to give different color to these different but you can create a concatenation of different
‫colors so you will use the C function and within bracket will mentioned the four different colors red
‫comma green comma blue comma
‫blue comma bridge Lucy decade and renders you can see the colors have changed the bottom one is in red
‫color then green and blue invasion if you want to look at the list of all the colors available with
‫R you can draw straight colors open and close brocade
‫in this control window you can see on the list of colors so it has a lot of colors apart from entering
‫the name of this color you can also use this particular number.
‫So basically colors of the array of these values.
‫So if you mentioned colors and within square brackets you mentioned the number of discoloured although
‫you'll get the same color.
‫So these are all the colors available with you.
‫Now if we want to remove this black boundary around each of these bodies will add another parameter
‫and that is called Border is equal to any
‫two all right.
‫Murder is equal to any
‫controlling debt so you can see the outside border which was black and.
‫That border is removed from all the buzz.
‫Now if you are going to use this chart in some presentation this chart should have a title to add a
‫title to this bad plot.
‫You need to use a barometer.
‫You mean
‫so after border will add up parameter called mean is equal to within.
‫Double quotation marks will give the title of this chart.
‫So it is frequencies of
‫this frequency of regions.
‫If you run this this chart now has a title.
‫If you have a longer title and you want to use the next lane you can use this special character.
‫Uh this escape character with n which signifies that you want to use the next lane.
‫So the first language contain only frequency of and after that the next lane will have regions.
‫So if you want to break the title into two lanes use slash and burn.
‫If you also want to label the x axis to label x axis there is a barometer called X Lab so we copy paste
‫this whole again and in the end we will add a parameter called X Lab is equal to and within double quotation
‫marks will give the number of customers
‫who do control enter number of customers there is no Indy is now the label of x axis so I think our
‫bar plot is ready now we can use this bar plot in our presentation to use this bar plot we need to export
‫this chart into the form of the image or a PD if there are two ways to export this graph into image.
‫One is today.
‫D Come on that if you run this command you'll get an image in the location that you specify the other
‫is a simpler one.
‫This comes with us to the only if you're going this blog there is an export option within this if you
‫click on save an image you can save this image give the image format debate height and the directory
‫where you want to save it and if you click on Save it will be saved as an image but this comes only
‫with our studio I'll just show you the I'll just show you the command.
‫Also if you are working on art and not art studio you'll have to done this command to get debar upload
‫an image format
‫so this is the code to generate BND you started writing PND after that that there is a parameter where
‫you will give the location of file and the name of the file that you want to save it as then they wait
‫and then decide when you write this name of PND saving device will start debarred plot you will draw
‫after this line once this bomb plot is gone you'll have to switch off the device.
‫So this the third line is also very important.
‫David out of this will switch off the device.
‫So in the second line we have written the holds index of bad plot which whichever parameters you we
‫discussed whichever we want to keep.
‫We do not want to keep.
‫We can have it here once we draw this bar plot here then we switch off the device will see that a PND
‫file is saying that the location that we have specified this is not required if we are working on our
‫studio if you are using our studio better use this image save as emergency was of options.