- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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 create a frequency polygon in R?
Frequency polygons are the graphs of the values to understand the shape of the distribution of the values. They are useful in comparing different data sets and visualising cumulative frequency distribution of the data sets. In base R, we can use polygon function to create the frequency polygon but first we should create a line plot for the two variables under consideration.
Example
Consider the below vectors x and y −
set.seed(999) x<-1:10 y<-sample(2:10,10,replace=TRUE)
Creating the frequency polygon with red color −
plot(x,y,type="l") polygon(c(1,x,10),c(0,y,0),col="red")
Output
Creating the frequency polygon with blue color −
polygon(c(1,x,10),c(0,y,0),col="blue")
Output
- Related Articles
- How to create a transparent polygon using ggplot2 in R?
- How to create bin frequency table in R?
- How to create frequency table of data.table in R?
- How to create histogram with relative frequency in R?
- How to create frequency table of a string vector in R?
- What is Frequency polygon ? Explain the steps to draw frequency polygon.
- How to create a frequency table in data frame format in R?
- How to create relative frequency table using dplyr in R?
- How to create a Polygon using JavaFX?
- How to create a frequency table in R that includes zero frequency for value that are not available?
- How to create a frequency column for categorical variable in an R data frame?
- How to create a frequency table of a vector that contains repeated values in R?
- How to create a canvas with Polygon using FabricJS?
- How to create a Polygon with Polyline using FabricJS?
- How to create a table of frequency for range of values in an R data frame column?

Advertisements