Hi, I'm new to R. I'm trying to plot my data into a circle. my data sort of looks like 12,12,4,5,6,5,11,10,3,9,9,9,12,12,2 total of 15 numbers. I'm trying to add all the same numbers, such that, there are 4 of 12s,1 of 11, 1 of 10, 3 of 9s, and such.... so the circle plot would have 4 parts of 12, 1 part of 11, 1 part of 10, 3 part of 9, and such... I tried >plot(circular(maxday[,2]*2*pi/12)) ##where maxday[,2] looks like the data above. but the only thing came out was dots, and they over wrote on each other. basically I would like to plot a pizza shape circle, where some of the slices are bigger than others. Thank you very much. [[alternative HTML version deleted]]
Hi, does y<-c(12,12,4,5,6,5,11,10,3,9,9,9,12,12,2) pie(table(y)) suits you? Where does "circular" come from? Am 07.02.2011 21:20, schrieb Bobby Lee:> Hi, I'm new to R. I'm trying to plot my data into a circle. > my data sort of looks like 12,12,4,5,6,5,11,10,3,9,9,9,12,12,2 total of 15 > numbers. > I'm trying to add all the same numbers, such that, there are 4 of 12s,1 of > 11, 1 of 10, 3 of 9s, and such.... > so the circle plot would have 4 parts of 12, 1 part of 11, 1 part of 10, 3 > part of 9, and such... > > I tried >plot(circular(maxday[,2]*2*pi/12)) > ##where maxday[,2] looks like the data above. > but the only thing came out was dots, and they over wrote on each other. > basically I would like to plot a pizza shape circle, where some of the > slices are bigger than others. > > Thank you very much. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Eik Vettorazzi Institut f?r Medizinische Biometrie und Epidemiologie Universit?tsklinikum Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790
You may want to look at the density.circular and plot.density.circular functions in the circular package. The pie slice idea is a bit tricky because the human eye tends to compare the areas of the slices rather than the distance from the center (and the area will be proportional to the distance squared). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Bobby Lee > Sent: Monday, February 07, 2011 1:21 PM > To: R-help at r-project.org > Subject: [R] circular > > Hi, I'm new to R. I'm trying to plot my data into a circle. > my data sort of looks like 12,12,4,5,6,5,11,10,3,9,9,9,12,12,2 total of > 15 > numbers. > I'm trying to add all the same numbers, such that, there are 4 of 12s,1 > of > 11, 1 of 10, 3 of 9s, and such.... > so the circle plot would have 4 parts of 12, 1 part of 11, 1 part of > 10, 3 > part of 9, and such... > > I tried >plot(circular(maxday[,2]*2*pi/12)) > ##where maxday[,2] looks like the data above. > but the only thing came out was dots, and they over wrote on each > other. > basically I would like to plot a pizza shape circle, where some of the > slices are bigger than others. > > Thank you very much. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code.