I am trying to construct a graph of 6 box plots of blood pressures. I want them to be on a single set of axis and I want the SBP to be ontop of the DBP. I have an array bp with the data in it and I tried a[1,]<-c(145,60,147,62,140,57) a[2,]<-c(160,75,160,74,160,70) a[3,]<-c(140,55,140,65,142,55) boxplot(data.frame(a), main = "Blood Pressures", at=c(1,1,2,2,3,3), names=c("sit","","lie","","stand","")) which is close to what I want, but it gives me a bunch of empty space at the end. is there a better way to do this to avoid this? As always, Thank You. ~Erithid
BJ wrote:> I am trying to construct a graph of 6 box plots of blood pressures. I > want them to be on a single set of axis and I want the SBP to be ontop > of the DBP. I have an array bp with the data in it and I triedFolks, please invest 1 minute of time to rethink whether other people will understand your question! What is "SBP", "DBP", and where are the "6" boxplots from?> a[1,]<-c(145,60,147,62,140,57)"a" must already be defined here, or we cannot replace a column!> a[2,]<-c(160,75,160,74,160,70) > a[3,]<-c(140,55,140,65,142,55) > boxplot(data.frame(a), main = "Blood Pressures", at=c(1,1,2,2,3,3), > names=c("sit","","lie","","stand","")) > > which is close to what I want, but it gives me a bunch of empty space at > the end. is there a better way to do this to avoid this?Well, the first point is that you should write questions that you would understand yourself. In a next step you might find someone who is able to answer it ....> As always, Thank You. ~Erithid"As always"? Does not sound very enthusiastic ... Uwe Ligges> > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html
Does it matter what they are? they are just names. The six box plots are from the array I created with columns. I forgot to add teh dim statement, my mistake. But I thought it was obvious that i was using a matrix from the data frame call and the assignments I provided. My question was simply about setting the x axis so that it stopped after x=3, even though I had 6 plots. For teh record, before I get jumped on for the statistics, I am just using a 3 x 6 matrix to test the code before applying it to actual data. Also, I was not being scarcastic. I have recieved a lot of help from this mailing list. The R documentation is hard to hunt down and not complete. Without the help of actual people I would be dead in the water. I am sorry for any hostility that I have incurred. ~Erithid Uwe Ligges wrote:> BJ wrote: > >> I am trying to construct a graph of 6 box plots of blood pressures. I >> want them to be on a single set of axis and I want the SBP to be >> ontop of the DBP. I have an array bp with the data in it and I tried > > > > Folks, please invest 1 minute of time to rethink whether other people > will understand your question! > > What is "SBP", "DBP", and where are the "6" boxplots from? > >> a[1,]<-c(145,60,147,62,140,57) > > > "a" must already be defined here, or we cannot replace a column! > >> a[2,]<-c(160,75,160,74,160,70) >> a[3,]<-c(140,55,140,65,142,55) >> boxplot(data.frame(a), main = "Blood Pressures", at=c(1,1,2,2,3,3), >> names=c("sit","","lie","","stand","")) >> >> which is close to what I want, but it gives me a bunch of empty space >> at the end. is there a better way to do this to avoid this? > > > Well, the first point is that you should write questions that you > would understand yourself. In a next step you might find someone who > is able to answer it .... > >> As always, Thank You. ~Erithid > > > "As always"? Does not sound very enthusiastic ... > > > Uwe Ligges > > > >> >> ______________________________________________ >> R-help at stat.math.ethz.ch mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide! >> http://www.R-project.org/posting-guide.html > > >
On Fri, 2005-05-27 at 10:17 -0400, BJ wrote:> I am trying to construct a graph of 6 box plots of blood pressures. I > want them to be on a single set of axis and I want the SBP to be ontop > of the DBP. I have an array bp with the data in it and I tried > > a[1,]<-c(145,60,147,62,140,57) > a[2,]<-c(160,75,160,74,160,70) > a[3,]<-c(140,55,140,65,142,55) > boxplot(data.frame(a), main = "Blood Pressures", at=c(1,1,2,2,3,3), > names=c("sit","","lie","","stand","")) > > which is close to what I want, but it gives me a bunch of empty space at > the end. is there a better way to do this to avoid this? > > As always, Thank You. ~ErithidTo answer both of your posts, use the following: # Review how your data is structured above. Your code for creating "a" # is not replicable. For those lacking clinical insight, explaining # your acronyms would also be helpful... :-) SBP <- matrix(c(145, 160, 140, 147, 160, 140, 140, 160, 142), ncol = 3) DBP <- matrix(c(60, 75, 55, 62, 74, 65, 57, 70, 55), ncol = 3) colnames(SBP) <- colnames(DBP) <- c("sit","lie","stand") # The key here is to only plot three at a time, lest boxplot() # default to a 'xlim' of 0.5 to 6.5 (1:# of groups +/- 0.5) # Then use 'add = TRUE' to plot the second group of 3 # Note also that I set the 'ylim' to the range of the combined # values in the first plot. boxplot(data.frame(SBP), main = "Blood Pressures", ylim = range(c(SBP, DBP)), whisklty = 0, staplelty = 0) boxplot(data.frame(DBP), add = TRUE, whisklty = 0, staplelty = 0) Note the final two arguments, which result in the whiskers being drawn with an "invisible" line. See ?boxplot and ?bxp for more information. HTH, Marc Schwartz
BJ- For the record as well I could not make heads or tails of your question. The dedicated folks who day in, day out field poorly specified questions have no obligation to do so, and have every right to get frustrated when it seems that their time is being taken advantage of. On Fri, 27 May 2005, BJ wrote:> Date: Fri, 27 May 2005 11:01:39 -0400 > From: BJ <erithid at bellsouth.net> > To: Uwe Ligges <ligges at statistik.uni-dortmund.de> > Cc: r-help at stat.math.ethz.ch > Subject: Re: [R] plotting box plots on same x > > Does it matter what they are? they are just names. The six box plots are > from the array I created with columns. I forgot to add teh dim > statement, my mistake. But I thought it was obvious that i was using a > matrix from the data frame call and the assignments I provided. My > question was simply about setting the x axis so that it stopped after > x=3, even though I had 6 plots. For teh record, before I get jumped on > for the statistics, I am just using a 3 x 6 matrix to test the code > before applying it to actual data. Also, I was not being scarcastic. I > have recieved a lot of help from this mailing list. The R documentation > is hard to hunt down and not complete. Without the help of actual people > I would be dead in the water. I am sorry for any hostility that I have > incurred. ~Erithid > > Uwe Ligges wrote: > > > BJ wrote: > > > >> I am trying to construct a graph of 6 box plots of blood pressures. I > >> want them to be on a single set of axis and I want the SBP to be > >> ontop of the DBP. I have an array bp with the data in it and I tried > > > > > > > > Folks, please invest 1 minute of time to rethink whether other people > > will understand your question! > > > > What is "SBP", "DBP", and where are the "6" boxplots from? > > > >> a[1,]<-c(145,60,147,62,140,57) > > > > > > "a" must already be defined here, or we cannot replace a column! > > > >> a[2,]<-c(160,75,160,74,160,70) > >> a[3,]<-c(140,55,140,65,142,55) > >> boxplot(data.frame(a), main = "Blood Pressures", at=c(1,1,2,2,3,3), > >> names=c("sit","","lie","","stand","")) > >> > >> which is close to what I want, but it gives me a bunch of empty space > >> at the end. is there a better way to do this to avoid this? > > > > > > Well, the first point is that you should write questions that you > > would understand yourself. In a next step you might find someone who > > is able to answer it .... > > > >> As always, Thank You. ~Erithid > > > > > > "As always"? Does not sound very enthusiastic ... > > > > > > Uwe Ligges > > > > > > > >> > >> ______________________________________________ > >> R-help at stat.math.ethz.ch mailing list > >> https://stat.ethz.ch/mailman/listinfo/r-help > >> PLEASE do read the posting guide! > >> http://www.R-project.org/posting-guide.html > > > > > > > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >J.R. Lockwood 412-683-2300 x4941 lockwood at rand.org http://www.rand.org/statistics/bios/ -------------------- This email message is for the sole use of the intended recip...{{dropped}}