Muthayammal College of Arts and Science Rasipuram: Assignment No - 2
Muthayammal College of Arts and Science Rasipuram: Assignment No - 2
Rasipuram
Assignment No - 2
Name : K.Haritha
Roll no : 21UST004
Date :
K.Haritha
1.BAR DIAGRAM
Syntax
H: This parameter is a vector or matrix containing numeric values which are used in bar
chart.
names.arg: This parameter is a vector of names appearing under each bar in bar chart.
col: This parameter is used to give colors to the bars in the graph.
PROGRAM
c1<-1995:2000;
c2<-c(15,25,27,28,26,26.6);
sales.year<-data.frame(year=c1,sales=c2);
sales.year;
attach(sales.year);
barplot(sales,xlab="year",ylab="sales",main="",col="white");
OUTPUT
BAR DIAGRAM IN R
2.HISTOGRAM
PROGRAM
# Create a histogram
hist(data,
OUTPUT
HISTOGRAM IN R
3.OGIVE CURVE
PROGRAM
# Sample data
data <- c(10, 15, 20, 25, 30, 35, 40, 45, 50)
plot(unique(data), cum_freq,
OGIVE IN R
4.FREQUENCY POLYGON
PROGRAM
data <- c(23, 25, 30, 32, 35, 38, 40, 42, 45, 50, 55, 60)
# Create a histogram
plot(hist_data$mids, hist_data$counts,
FREQUENCY POLYGON IN R