Professional Documents
Culture Documents
Bar Graphs
Bar Graphs
> table(CO2$conc)
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”)
>
>