##Pie charts Program:
data("chickwts")
# main is used to create
# an heading for the chart
d = table(chickwts$feed)
pie(d[order(d, decreasing=TRUE)], clockwise=TRUE, main="Pie Chart of feeds from chichwits", )
data(chickwts)
#loading data into workspace
plot(chickwts$feed)
# plot feed from chickwts
feeds=table(chickwts$feed)
# plots graph in decreasing order
barplot(feeds[order(feeds, decreasing=TRUE)])
feeds = table(chickwts$feed)
# outside margins bottom, left, top, right.
par(oma=c(1, 1, 1, 1))
par(mar=c(4, 5, 2, 1))
# las is used orientation of axis labels
barplot(feeds[order(feeds, decreasing=TRUE)]
# horiz is used for bars to be shown as horizontal.
barplot(feeds[order(feeds)], horiz=TRUE,
# col is used for colouring bars.
# xlab is used to label x-axis.
xlab="Number of chicks", las=1 col="yellow")
##Boxplot using notch Program:
# Plot the chart.
boxplot(mpg ~ cyl, data = mtcars,
xlab = "Number of Cylinders", ylab = "Miles Per Gallon",
main = "Mileage Data", notch = TRUE,
varwidth = TRUE,
col = c("green", "red", "blue"),
names = c("High", "Medium", "Low") )
To embed this program on your website, copy the following code and paste it into your website's HTML: