#5, First Floor, 4th Street , Dr. Subbarayan Nagar, Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to create boxplot in R?
Description

To create a boxplot for the given data using R programming.

Process

Boxplot:

  Measure how well data is distributed in a data set.

   Divides the data set into three quartiles.

   Represents the minimum, maximum, median, first quartile and third quartile in the data set.

  Useful in comparing the distribution of data across data sets by drawing boxplots for each of them.

   R Function : boxplot()

Sapmle Code

#Data Visualization in Box plot

#Read File
print(getwd())
setwd(“/home/soft13″)
print(getwd())
data<-read.csv(‘input.csv’)
print(data)

#Box Plot
age<-c(34,34,10,20,10,20,34,10)
boxplot(data$salary~age,main=”Box Plot”,xlab=”Age”,ylab=”Salary”,col=”green”)

#Adding Notch
boxplot(data$salary~age,main=”Box Plot”,xlab=”Age”,ylab=”Salary”,col=”green”,notch=TRUE)

Screenshots