You are on page 1of 1

PIE CHART AND BAR GRAPH

> table(CO2$conc)

95 175 250 350 500 675


12 12 12 12 12 12
1000
12
> count<-table(CO2$conc) (under the group of count)
> count

95 175 250 350 500 675


12 12 12 12 12 12
1000
12
> table(CO2$conc)/84

95 175 250
0.1428571 0.1428571 0.1428571
350 500 675
0.1428571 0.1428571 0.1428571
1000
0.1428571
> #expressed as % or relative frequencies
>
> percent<-table(CO2$conc)/84 (under the group of percent)
>
> barplot(count)
> barplot(percent)
> barplot(percent,main="GRAPH",xlab="conc",ylab="%")
> View(colors)
> barplot(percent,main="GRAPH",xlab="conc",ylab="%",las=1)
> #las command to ROTATE THE VALUES
>
> #to change the position of the bars use 'horiz=TRUE' and change the xlab and
ylab
>
> #to change the name under the bars use 'name.arg=c("name")
>
> (col='thistle')
[1] "thistle"
> barplot(percent,main="GRAPH",xlab="conc",ylab="%",las=1, col='thistle')
>
>
> #PIE CHARTS
>
> pie(count, main=”TITLE here”)
>
>

You might also like