

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 Questions & Answers
- How to create a transparent polygon using ggplot2 in R?
- How to create bin frequency table in R?
- How to create a Polygon using JavaFX?
- How to create frequency table of a string vector in R?
- How to create frequency table of data.table in R?
- How to create histogram with relative frequency in R?
- 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 frequency table in R that includes zero frequency for value that are not available?
- How to create a frequency table of a vector that contains repeated values in R?
- How to create a frequency column for categorical variable in an R data frame?
- How to create a table of frequency for range of values in an R data frame column?
- How to create a sphere in R?
- How to draw a polygon in HTML5 SVG?
- How to create a polynomial model in R?
Advertisements