![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to define the number of breaks in base R histogram?
To define the number of breaks in base R histogram, we can use breaks argument along with hist function.
Create the histogram with small number of breaks
Use a vector with normal distribution and the histogram of the same vector with ten breaks −
x<-rnorm(10000) hist(x,breaks=10)
Output
Create the histogram with medium number of breaks
Use a vector with normal distribution and the histogram of the same vector with fifty breaks −
x<-rnorm(10000) hist(x,breaks=50)
Output
Create the histogram with large number of breaks
Use a vector with normal distribution and the histogram of the same vector with twohundred breaks −
x<-rnorm(10000) hist(x,breaks=200)
Output
Create the histogram with medium number of breaks
Use a vector with normal distribution and the histogram of the same vector with fifty breaks −
x<-rnorm(10000) hist(x,breaks=50)
Output
Advertisements