Documents

Plots

Description
r-plots
Categories
Published
of 2
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
  # install.packages(c('vcd', 'plotrix', 'sm', 'vioplot'))# Load vcd packagelibrary(vcd)# Get cell counts for improved variablecounts < table(!rt ritis$mproved)counts# simple bar plotbarplot(counts, main % &imple ar lot&, xlab % &$mprovement&, ylab % &*re+uency&)# oriontal bar plotbarplot(counts, main % &-oriontal ar lot&, xlab % &*re+uency&, ylab % &$mprovement&, ori % /01)# get counts for $mproved by reatment tablecounts < table(!rt ritis$mproved, !rt ritisreatment)counts# Listing 2.3  tacked and groupde bar plots# stacked barplotbarplot(counts, main % &tacked ar lot&, xlab % &reatment&, ylab % &*re+uency&, col % c(&red&, &yello4&, &green&), legend % ro4names(counts))# grouped barplotbarplot(counts, main % &Grouped ar lot&, xlab % &reatment&, ylab % &*re+uency&, col % c(&red&, &yello4&, &green&), legend % ro4names(counts), beside % /01)# Listing 2.5  ie c arts#par(mfro4 % c(3, 3))slices < c(67, 63, 8, 62, 9)lbls < c(&0&, &0:&, &!ustralia&, &Germany&, &*rance&)pie(slices, labels % lbls, main % &imple ie ; art&)library(plotrix)pie=(slices, labels % lbls, explode % 7.6, main % &= ie ; art &) ist(mtcarsmpg) ist(mtcarsmpg, col % &red&, xlab % &>iles er Gallon&, main % &;olored istogram 4it 63 bins&)  boxplot(mpg ? cyl, data % mtcars, main % &;ar >ilage =ata&, xlab % &@umber of ;ylinders&, ylab % &>iles er Gallon&)boxplot(mpg ? cyl, data % mtcars, notc % /01, var4idt % /01, col % &red&, main % &;ar >ileage =ata&, xlab % &@umber of ;ylinders&, ylab % &>iles er Gallon&)
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks