[R] Boxplots in Barplots
Hii, Is it possible to put Boxplots at the top of the Barplots ? I will describe the standard derivation with a Boxplot at the of the Barplots. It could also be line instead of Boxplot... Can anybody help me how to do it ? greetings, j. -- View this message in context: http://www.nabble.com/Boxplots-in-Barplots-tp22907174p22907174.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] mtext in barplot
Hii, Can anybody help me to put a text under the barplots. I will describe the percental between six grouped barplots. I tried to do it with mtext but without success. Here is my code: test -read.table(file=D:/mobile.txt) pdf(file = D:/mobil126.pdf, width = 6.67, height = 5, onefile = TRUE, family = Helvetica, title = R Graphics Output, fonts = NULL, version = 1.1, bg=white, pointsize=10) barplot(as.matrix(test), main=OLSR,xlab=Hops, col=c(skyblue1,salmon),width- c(1,1),names=c(2-1,4-2,3-1,2-1,2-1,1-2), legend = rownames(x), beside=TRUE) legend(topright, c(OLSR),cex=0.8,ncol =1.5,col = c(red),bg=c(lightskyblue1)) dev.off() I tired to do it with mtext(side=1,at=x, text =c(Mean, rere), col = red), line = 1, cex = 0.75) but without success, I get this example from a R tutorial... Can anybody help me please ? greetings, johnh -- View this message in context: http://www.nabble.com/mtext-in-barplot-tp22893563p22893563.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] diversify the values of the x-Axis...
Hii, Is it possible in R to write out to the graph the exact values of the X-Axis, even if the values are high ? I will avoid to get the values in this Form for example: 3e+06 Can anybody help ? -- View this message in context: http://www.nabble.com/diversify-the-values-of-the-x-Axis...-tp22705098p22705098.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Problems with combining plots
I have still the same problem... As you said I tried with par(mfrow=c(2,1)) and par(mfrow=c(1,2)) but without success. Could R compiler be the problem ? Wills, Kellie wrote: par(mfrow=c(1,1)) will give you just one panel. Try par(mfrow=c(2,1)) or par(mfrow=c(1,2)). -Original Message- From: r-help-boun...@r-project.org on behalf of johnhj Sent: Sun 3/22/2009 10:50 AM To: r-help@r-project.org Subject: [R] Problems with combining plots Hii, I will combine some plots. Like this example here http://www.statmethods.net/advgraphs/layout.html I tired to do it for 2 plots but without success. Here is my code: test-read.table(file=D:/file.txt) space-read.table(file=D:/space.txt) space$gruppe - 502*rep(1:6, each=7) x- c(test$V1) y- c(test$V2) par(mfrow=c(1,1)) png(filename = D:/example.png, width = 640, height = 480, pointsize = 12, bg = white, res = NA) boxplot(V2 ~ gruppe , data = space , col = lightgray,boxwex=0.2) plot(panel.first=grid(ny=NULL,nx=NULL),x,y, xlab = Zeit(sec), ylab =Datenrate(MBit(sec)),ylim=c(0,40), col =purple, type =l, main =combined plots,lwd=2) dev.off() What is the mistake in my code ? -- View this message in context: http://www.nabble.com/Problems-with-combining-plots-tp22646692p22646692.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. __ R-help@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. -- View this message in context: http://www.nabble.com/Problems-with-combining-plots-tp22646692p22658673.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Plot and Boxplot in the same graph
I tried to do it with: y - rnorm(100) x - gl(2,50) boxplot(x,y) points(x,y) But the problem is, that the the y coordinates are shown for the boxplot and not for points(x,y) Is it possible to show the graph with the (x,y) coordinates with the points() function and the boxplots only for the x coordinates. A better solution could be to have a seperated y axis on the left side for the boxplots(). Is it possible to do it in this was ? Paul Johnson-11 wrote: On Fri, Mar 20, 2009 at 10:02 PM, johnhj jhar...@web.de wrote: Hii, Is it possible, to use the plot() funktion and the boxplot() funktion together ? I will plot a simple graph and additionally to the graph on certain places boxplots. I have imagined to plot the graph a little bit transparency and show in the same graph on certain places boxplots Is it possible to do it in this way ? greetings, johnh -- Run the boxplot first, then use points() or other subsidiary plot functions to add the points in the figure. y - rnorm(100) x - gl(2,50) boxplot(x,y) points(x,y) -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas __ R-help@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. -- View this message in context: http://www.nabble.com/Plot-and-Boxplot-in-the-same-graph-tp22632355p22645076.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] Problems with combining plots
Hii, I will combine some plots. Like this example here http://www.statmethods.net/advgraphs/layout.html I tired to do it for 2 plots but without success. Here is my code: test-read.table(file=D:/file.txt) space-read.table(file=D:/space.txt) space$gruppe - 502*rep(1:6, each=7) x- c(test$V1) y- c(test$V2) par(mfrow=c(1,1)) png(filename = D:/example.png, width = 640, height = 480, pointsize = 12, bg = white, res = NA) boxplot(V2 ~ gruppe , data = space , col = lightgray,boxwex=0.2) plot(panel.first=grid(ny=NULL,nx=NULL),x,y, xlab = Zeit(sec), ylab =Datenrate(MBit(sec)),ylim=c(0,40), col =purple, type =l, main =combined plots,lwd=2) dev.off() What is the mistake in my code ? -- View this message in context: http://www.nabble.com/Problems-with-combining-plots-tp22646692p22646692.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] Plot and Boxplot in the same graph
Hii, Is it possible, to use the plot() funktion and the boxplot() funktion together ? I will plot a simple graph and additionally to the graph on certain places boxplots. I have imagined to plot the graph a little bit transparency and show in the same graph on certain places boxplots Is it possible to do it in this way ? greetings, johnh -- View this message in context: http://www.nabble.com/Plot-and-Boxplot-in-the-same-graph-tp22632355p22632355.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] changing the description of the x-axi
Hii, Is it possible to change the description ot the x-axis ? I need some barplots with high x-axis values. After plotting the graph, the x-axis values are shown in this form: 0e+00 1e+06 2e+06 3e+06 4e+06 5e+06 6e+06 Can I change this description to numerary values, like 5354352 ? greetings, johnh -- View this message in context: http://www.nabble.com/changing-the-description-of-the-x-axi-tp22537009p22537009.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Save the elements of an atomic vector to a text fil
I can save a atomic vector with the write.table function so far... But how can I save 2 vectors to a text file ? I tried to do it by merging 2 vector to 1 vector like this here: summary_vector-c(vector1, vector2) and tried to write the contents of summary_vector to a textfile with: write.table(summary_vector, file= (my file etc.)) But I cann't write 2 vectors with this function to a file... can anybody help how to do ? greetings, johnh Usuario R wrote: Hi, take a look to ?write.table regards 2009/3/13 johnhj jhar...@web.de Hii, I will save the elements of the vector median-with(x, tapply(V3, grup, median)). The output of this vector is: 25 50 75 100 125 150 175 200 225 250 275 300 325 350 375 400 425 450 475 500 17.8 17.8 17.5 17.8 17.7 17.6 17.7 17.6 17.8 17.7 17.6 17.7 17.8 17.7 17.8 17.8 17.8 17.8 17.7 17.7 Can anybody help me how to do it. I will save it to a text file... greetings, johnh -- View this message in context: http://www.nabble.com/Save-the-elements-of-an-atomic-vector-to-a-text-fil-tp22498222p22498222.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. [[alternative HTML version deleted]] __ R-help@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. -- View this message in context: http://www.nabble.com/Save-the-elements-of-an-atomic-vector-to-a-text-fil-tp22498222p22546554.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] print median and sd...
Hii, Can anybody help me, I don't know how to print the median. Below is my code snipplet... x -read.table(file=D:/Uni/Diplom/Diplom/Grafiken/R/BATMAN/Kabel/Batman1hop/Standardabweichung__output_30_1_Kabel(30m)_b.txt) png(filename = D:/Grafiken/R/Standardabweichung/Kopie.png, width = 640, height = 480,pointsize = 12, bg = white, res = NA) median-with(x, tapply(V3, grup, median)) ??? dev.off() I will print, the median values with a simple line.. I tried many things but without success... I would be very appreciate, if anyone could help me... greetings, John -- View this message in context: http://www.nabble.com/print-median-and-sd...-tp22489185p22489185.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] print median and sd...
Hii Jholtman, I will make a graph of the median values and not to print to the console. I tried to plot with: plot(V3 ~ grup, data = median) ?? but I get an error message. I also tried to print the output of median-with(x, tapply(V3, grup, median)) to a text file with the X and Y Koordinates to plot it explicit with plot(x,y) but I could not figure out the X Values. I have not su much experience with R, I would be thankful if you could help me... jholtman wrote: Where do you want to print it? Is it the console (if so, try 'print(median)') or if it is the plot, use 'text' with the appropriate parameters. It would help if you listed the I tried many things but without success... and what you were expecting vs. what you got. Reproducible code would be useful (and required). On Thu, Mar 12, 2009 at 10:42 PM, johnhj jhar...@web.de wrote: Hii, Can anybody help me, I don't know how to print the median. Below is my code snipplet... x -read.table(file=D:/Uni/Diplom/Diplom/Grafiken/R/BATMAN/Kabel/Batman1hop/Standardabweichung__output_30_1_Kabel(30m)_b.txt) png(filename = D:/Grafiken/R/Standardabweichung/Kopie.png, width = 640, height = 480,pointsize = 12, bg = white, res = NA) median-with(x, tapply(V3, grup, median)) ??? dev.off() I will print, the median values with a simple line.. I tried many things but without success... I would be very appreciate, if anyone could help me... greetings, John -- View this message in context: http://www.nabble.com/print-median-and-sd...-tp22489185p22489185.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? __ R-help@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. -- View this message in context: http://www.nabble.com/print-median-and-sd...-tp22489185p22495481.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] Save the elements of an atomic vector to a text fil
Hii, I will save the elements of the vector median-with(x, tapply(V3, grup, median)). The output of this vector is: 25 50 75 100 125 150 175 200 225 250 275 300 325 350 375 400 425 450 475 500 17.8 17.8 17.5 17.8 17.7 17.6 17.7 17.6 17.8 17.7 17.6 17.7 17.8 17.7 17.8 17.8 17.8 17.8 17.7 17.7 Can anybody help me how to do it. I will save it to a text file... greetings, johnh -- View this message in context: http://www.nabble.com/Save-the-elements-of-an-atomic-vector-to-a-text-fil-tp22498222p22498222.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] print median and sd...
Ok, sorry... here is my code so far... x -read.table(file=D:/output.txt) x$grup - 25*rep(1:144, each=5) median-with(x, tapply(V3, grup, median)) sd-with(x, tapply(V3, grup, sd)) I will plot to types of graph. One graph with the median values for example with the plot() function, the other one is the standard derivation. I will plot the s.d. with barplot(). What do you think, is it generally common to plot the s.d. with his histograms ? jholtman wrote: Can you provide a reproducible example with the data so that we understand what you are working with. Need to see what the structure of 'x' and 'median' are. On Fri, Mar 13, 2009 at 8:35 AM, johnhj jhar...@web.de wrote: Hii Jholtman, I will make a graph of the median values and not to print to the console. I tried to plot with: plot(V3 ~ grup, data = median) ?? but I get an error message. I also tried to print the output of median-with(x, tapply(V3, grup, median)) to a text file with the X and Y Koordinates to plot it explicit with plot(x,y) but I could not figure out the X Values. I have not su much experience with R, I would be thankful if you could help me... jholtman wrote: Where do you want to print it? Is it the console (if so, try 'print(median)') or if it is the plot, use 'text' with the appropriate parameters. It would help if you listed the I tried many things but without success... and what you were expecting vs. what you got. Reproducible code would be useful (and required). On Thu, Mar 12, 2009 at 10:42 PM, johnhj jhar...@web.de wrote: Hii, Can anybody help me, I don't know how to print the median. Below is my code snipplet... x -read.table(file=D:/Uni/Diplom/Diplom/Grafiken/R/BATMAN/Kabel/Batman1hop/Standardabweichung__output_30_1_Kabel(30m)_b.txt) png(filename = D:/Grafiken/R/Standardabweichung/Kopie.png, width = 640, height = 480,pointsize = 12, bg = white, res = NA) median-with(x, tapply(V3, grup, median)) ??? dev.off() I will print, the median values with a simple line.. I tried many things but without success... I would be very appreciate, if anyone could help me... greetings, John -- View this message in context: http://www.nabble.com/print-median-and-sd...-tp22489185p22489185.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? __ R-help@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. -- View this message in context: http://www.nabble.com/print-median-and-sd...-tp22489185p22495481.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? __ R-help@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. -- View this message in context: http://www.nabble.com/print-median-and-sd...-tp22489185p22499716.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Save the elements of an atomic vector to a text fil
Thank you all, I did it with write.table... greetings, johnh johnhj wrote: Hii, I will save the elements of the vector median-with(x, tapply(V3, grup, median)). The output of this vector is: 25 50 75 100 125 150 175 200 225 250 275 300 325 350 375 400 425 450 475 500 17.8 17.8 17.5 17.8 17.7 17.6 17.7 17.6 17.8 17.7 17.6 17.7 17.8 17.7 17.8 17.8 17.8 17.8 17.7 17.7 Can anybody help me how to do it. I will save it to a text file... greetings, johnh -- View this message in context: http://www.nabble.com/Save-the-elements-of-an-atomic-vector-to-a-text-fil-tp22498222p22499918.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] calculating standard deviation and variance
Hiii, I have some problems to plot standard deviation and variance from a texfile. Ich have the following code so far: x -read.table(file=new.txt) x$gruppe - 100*rep(1:36, each=20) png(filename = D:/Uni/new.png, width = 640, height = 480,pointsize = 12, bg = white) boxplot(V3 ~ gruppe, data = x, col = blue,boxwex=0.7,ylab =Datenrate(MBit(sec)),xlab = Zeit(sec)) dev.off() My question is, how can I plot the standard deviation and variance of x$gruppe - 100*rep(1:36, each=20) Can anybody help me please ? greetings, johnh -- View this message in context: http://www.nabble.com/calculating-standard-deviation-and-variance-tp22306851p22306851.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] connecting boxplots
Hiii, Thanks to all... Btw.: Is it possible to disable the description of extrem points in boxplots. I mean the points under the whisker's...in the image you can see what I mean... greetings, J http://www.nabble.com/file/p21425697/Test_Delay3_1_2.png Michael A. Miller wrote: johnhj jhar...@web.de wrote: Can you also describe me how to describe the standard deviation of the boxplots/matrices ? Try tapply: x -read.table(file=test.txt) x$group - rep(1:8, each=5) boxplot(V3~gruppe, data=x) with(x, tapply(V3, gruppe, sd)) Mike __ R-help@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. -- View this message in context: http://www.nabble.com/connecting-boxplots-tp21405459p21425697.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] connecting boxplots
@David Winsemius I have one more question to you... lines(boxplot(count ~ spray, data = InsectSprays, col = lightgray) $stats[c(1),] ) connects the lines through the values. But how can I connect the values min, max, median at the same time ? The code above make only one line, if I use this line above second time with an another row of the matrix, the first line of the max values are overwritten. How can I use: -$stats[c(1),] -$stats[c(3),] -$stats[c(5),] at the same time ? David Winsemius wrote: You do not provide a workable example and it appears you may be conflating the German and English spellings of group, but perhaps this code fragment using the first example in boxplots help menu will move you along. It results in drawing the connecting lines to the minimum value in each group. boxplot(count ~ spray, data = InsectSprays, col = lightgray) #draws the plot str(boxplot(count ~ spray, data = InsectSprays, col = lightgray) ) List of 6 $ stats: num [1:5, 1:6] 7 11 14 18.5 23 7 12 16.5 18 21 ... # Notice that the stats element is a matrix that has the first row as the minimums, third as the medians, and maxs are fifth. $ n: num [1:6] 12 12 12 12 12 12 $ conf : num [1:2, 1:6] 10.579 17.421 13.763 19.237 0.588 ... $ out : num [1:2] 7 12 $ group: num [1:2] 3 4 $ names: chr [1:6] A B C D ... boxplot(count ~ spray, data = InsectSprays, col = lightgray) $stats[c(1,5),] [,1] [,2] [,3] [,4] [,5] [,6] [1,]770219 # minimums [2,] 23 21466 26 # maximumns lines(boxplot(count ~ spray, data = InsectSprays, col = lightgray) $stats[c(1),] ) #adds the lines through minimums -- David Winsemius On Jan 11, 2009, at 8:00 PM, johnhj wrote: In other words: I will connect the median, min and the max area of the boxplot with a line. The function lines() could help me, but I don't know which parameters the lines() function should have. johnhj wrote: Hii, I created some boxplots with this commands: x -read.table(file=test.txt) x$group - rep(1:8, each=5) boxplot(V3~gruppe, data=x) Now, I will connect the boxplots to each other to the min, max and median values. Can anybody help me how to do it ? greetings, J __ R-help@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. -- View this message in context: http://www.nabble.com/connecting-boxplots-tp21405459p21426682.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] connecting boxplots
Thank you very much David... Can you also describe me how to describe the standard deviation of the boxplots/matrices ? David Winsemius wrote: You do not provide a workable example and it appears you may be conflating the German and English spellings of group, but perhaps this code fragment using the first example in boxplots help menu will move you along. It results in drawing the connecting lines to the minimum value in each group. boxplot(count ~ spray, data = InsectSprays, col = lightgray) #draws the plot str(boxplot(count ~ spray, data = InsectSprays, col = lightgray) ) List of 6 $ stats: num [1:5, 1:6] 7 11 14 18.5 23 7 12 16.5 18 21 ... # Notice that the stats element is a matrix that has the first row as the minimums, third as the medians, and maxs are fifth. $ n: num [1:6] 12 12 12 12 12 12 $ conf : num [1:2, 1:6] 10.579 17.421 13.763 19.237 0.588 ... $ out : num [1:2] 7 12 $ group: num [1:2] 3 4 $ names: chr [1:6] A B C D ... boxplot(count ~ spray, data = InsectSprays, col = lightgray) $stats[c(1,5),] [,1] [,2] [,3] [,4] [,5] [,6] [1,]770219 # minimums [2,] 23 21466 26 # maximumns lines(boxplot(count ~ spray, data = InsectSprays, col = lightgray) $stats[c(1),] ) #adds the lines through minimums -- David Winsemius On Jan 11, 2009, at 8:00 PM, johnhj wrote: In other words: I will connect the median, min and the max area of the boxplot with a line. The function lines() could help me, but I don't know which parameters the lines() function should have. johnhj wrote: Hii, I created some boxplots with this commands: x -read.table(file=test.txt) x$group - rep(1:8, each=5) boxplot(V3~gruppe, data=x) Now, I will connect the boxplots to each other to the min, max and median values. Can anybody help me how to do it ? greetings, J __ R-help@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. -- View this message in context: http://www.nabble.com/connecting-boxplots-tp21405459p21409779.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Boxplot from matrices
Thank you very much for you help... Carlos J. Gil Bellosta wrote: Hello, The following code may help you: my.matrix - matrix( rnorm(16), ncol = 4 ) boxplot( my.matrix ~ col( my.matrix ) ) Best regards, Carlos J. Gil Bellosta http://www.datanalytics.com On Sun, 2009-01-11 at 05:23 -0800, johnhj wrote: Hii, I will create boxplots from matrices. I have the following data sets: 5.0 1.78 2.99 2.019 0 10.0 1.79 3.00 1.744 0 15.0 1.78 2.98 1.936 0 20.0 1.78 2.99 1.975 0 25.0 1.73 2.91 3.591 0 30.0 1.79 3.00 1.966 0 35.0 1.79 3.00 2.451 0 40.0 1.79 3.00 1.853 0 45.0 1.79 3.00 2.077 0 50.0 1.79 3.00 1.943 0 55.0 1.79 3.00 2.608 0 60.0 1.79 3.00 1.790 0 65.0 1.79 3.00 1.893 0 70.0 1.79 3.00 2.079 0 75.0 1.77 2.97 2.200 0 80.0 1.79 3.01 1.868 0 85.0 1.78 2.99 2.179 0 90.0 1.70 2.85 2.305 0 95.0 1.71 2.87 1.854 0 100.0 1.79 3.00 2.362 0 105.0 1.79 3.00 3.634 0 110.0 1.79 3.00 1.578 0 115.0 1.79 3.00 1.835 0 120.0 1.79 3.00 2.359 0 125.0 1.79 3.00 2.542 0 130.0 1.76 2.95 2.620 0 135.0 1.79 3.00 4.181 0 140.0 1.79 3.00 1.375 0 145.0 1.79 3.00 2.872 0 150.0 1.79 3.00 3.002 0 155.0 1.79 3.00 3.712 0 160.0 1.79 3.01 3.175 0 165.0 1.79 3.00 2.821 0 170.0 1.79 3.00 3.320 0.078 175.0 1.79 3.00 2.076 0 180.0 1.77 2.97 2.186 0 185.0 1.78 2.99 4.652 0 190.0 1.79 3.01 2.051 0 195.0 1.79 3.00 1.922 0 200.0 1.79 3.00 1.945 0 The first thing I do is, to run the command y-matrix(c(test$V3),ncol=8) to divide the third column in 8 matrices to create 8 boxplots. The I run the command w-summary(y) to get the values min, max, mean, median, 1.Quan, 3.Quan My problem is, I cann't run the plot command to create the 8 boxplots in a graph... The command plot(y) gives me an error.. Can anybody help me to create the boxplot from matrices in a graph ? greetings, j __ R-help@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. -- View this message in context: http://www.nabble.com/Boxplot-from-matrices-tp21399085p21405169.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] connecting boxplots
Hii, I created some boxplots with this commands: x -read.table(file=test.txt) x$group - rep(1:8, each=5) boxplot(V3~gruppe, data=x) Now, I will connect the boxplots to each other to the min, max and median values. Can anybody help me how to do it ? greetings, J -- View this message in context: http://www.nabble.com/connecting-boxplots-tp21405459p21405459.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] connecting boxplots
In other words: I will connect the median, min and the max area of the boxplot with a line. The function lines() could help me, but I don't know which parameters the lines() function should have. johnhj wrote: Hii, I created some boxplots with this commands: x -read.table(file=test.txt) x$group - rep(1:8, each=5) boxplot(V3~gruppe, data=x) Now, I will connect the boxplots to each other to the min, max and median values. Can anybody help me how to do it ? greetings, J -- View this message in context: http://www.nabble.com/connecting-boxplots-tp21405459p21406749.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.