ggplot2 is an R Package that is dedicated to Data visualization. ggplot2 Package Improve the quality and the beauty (aesthetics ) of the graph. By Using ggplot2 we can make almost every kind of graph In RStudio
A histogram is an approximate representation of the distribution of numerical data. In a histogram, each bar groups numbers into ranges. Taller bars show that more data falls in that range. A histogram displays the shape and spread of continuous sample data.
Histograms roughly give us an idea about the probability distribution of a given variable by depicting the frequencies of observations occurring in certain ranges of values. Basically, Histograms are used to show distributions of a given variable while bar charts are used to compare variables. Histograms plot quantitative data with ranges of the data grouped into the intervals while bar charts plot categorical data.
geom_histogram() function is an in-built function of ggplot2 module.
- Import module
- Create dataframe
- Create histogram using function
- Display plot
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.