Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

EXPERIMENT NO:1

OBJECTIVE:

A group of 25 people was surveyed to find their soft drink


preferences, the categories of soft drink used in survey
were1:LIMCA 2:COCACOLA 3:PEPSI 4:MANGOLA

The data are as follows:


3,4,1,1,3,4,3,3,1,3,2,1,2,1,2,3,2,3,1,1,1,1,4,3,1

Represent data by: i) Barplot of frequency ii) Barplot of


proportion

SOLUTION:-

i)For Barplot of Frequency:-


>x=c(3,4,1,1,3,4,3,3,1,3,2,1,2,1,2,3,2,3,1,1,1,1,4,3,1)
>y=table(x)
>barplot(y,main=” BARPLOT OF SOFT DRINK
PREFERENCES”,xlab=”SOFTDRINK”,ylab=”FREQUENCY”,col=
c(1,2,3,4,5))
ii)For Barplot of Proportion:-
>z=table(x)/length(x)

>barplot(z,main=”BAR PLOT OF SOFTDRINK


PREFERENCES”,xlab=”SOFTDRINK”,ylab=”PROPORTION”,col
=c(1,2,3,4))
OUTPUT:

You might also like