Meredith Ballard LaBeau
2012-Sep-29 17:23 UTC
[R] Removing lower whisker in boxplot to see the effects of the high values
Good Afternoon- I was wanting to alter the boxplot to remove the lower whisker, both the whisker line and staple just on the lower end. Is there a way to do this? As my code is currently: boxplot(log_loads~ind,data=nfmaum, horizontal=TRUE, notch=T, outline=FALSE, whisker=0, main="Maumee River Near Future Climate Scenarios", ylab="Log Load",xlab="Climate Scenarios") I just want to better see the medians and high end tail. Thanks Meredith -- Doctoral Candidate Department of Civil and Environmental Engineering Michigan Technological University [[alternative HTML version deleted]]
David Winsemius
2012-Sep-29 17:46 UTC
[R] Removing lower whisker in boxplot to see the effects of the high values
On Sep 29, 2012, at 10:23 AM, Meredith Ballard LaBeau wrote:> Good Afternoon- > I was wanting to alter the boxplot to remove the lower whisker, both the > whisker line and staple just on the lower end. Is there a way to do this? > As my code is currently: > boxplot(log_loads~ind,data=nfmaum, horizontal=TRUE, notch=T, outline=FALSE, > whisker=0, main="Maumee River Near Future Climate Scenarios", ylab="Log > Load",xlab="Climate Scenarios")If you altered the value in what is passed from `boxplot.stats` to `bxp` so the lower whisker value was the same as the lower hinge value The lower whisker would merge into the hinge. `boxplot` returns those stats-values invisibly, so you just assign to an object name, make your changes and pass back to bxp.> > I just want to better see the medians and high end tail. > >-- David Winsemius, MD Alameda, CA, USA
David Winsemius
2012-Sep-29 19:46 UTC
[R] Removing lower whisker in boxplot to see the effects of the high values
On Sep 29, 2012, at 12:09 PM, Meredith Ballard LaBeau wrote:> David: > I set this up and it still seems to plot the same: > > maumnf_plot<-boxplot(log_loads~ind,data=nfmaum, horizontal=TRUE, notch=T, outline=FALSE, whisker=0, main="Maumee River Near Future Climate Scenarios", ylab="Log Load",xlab="Climate Scenarios") > maumnf_plot$stats[-1,] (to remove the lower whiskers) > bxp(maumnf_plot) > > this does not remove the whiskers....is there something I am missing in bxp?I said to replace the whisker value with the hinge value: maumnf_plot<-boxplot(log_loads~ind,data=nfmaum ) # only need the data to get the stats maumnf_plot$stats[1,] <- maumnf_plot$stats[2,] # Replaced whisker row with hinge row # The graphics arguments to bxp need to be in the second call. # They won't be carried over from the sats bxp(maumnf_plot, , horizontal=TRUE, notch=T, outline=FALSE, whisker=0, main="Maumee River Near Future Climate Scenarios", ylab="Log Load",xlab="Climate Scenarios") -- David> > Thanks > Meredith > > On Sat, Sep 29, 2012 at 1:46 PM, David Winsemius <dwinsemius@comcast.net> wrote: > > On Sep 29, 2012, at 10:23 AM, Meredith Ballard LaBeau wrote: > > > Good Afternoon- > > I was wanting to alter the boxplot to remove the lower whisker, both the > > whisker line and staple just on the lower end. Is there a way to do this? > > As my code is currently: > > boxplot(log_loads~ind,data=nfmaum, horizontal=TRUE, notch=T, outline=FALSE, > > whisker=0, main="Maumee River Near Future Climate Scenarios", ylab="Log > > Load",xlab="Climate Scenarios") > > If you altered the value in what is passed from `boxplot.stats` to `bxp` so the lower whisker value was the same as the lower hinge value The lower whisker would merge into the hinge. `boxplot` returns those stats-values invisibly, so you just assign to an object name, make your changes and pass back to bxp. > > > > > > I just want to better see the medians and high end tail. > > > > > -- > > David Winsemius, MD > Alameda, CA, USA > > > > > -- > Doctoral Candidate > Department of Civil and Environmental Engineering > Michigan Technological University > >David Winsemius, MD Alameda, CA, USA [[alternative HTML version deleted]]
David Winsemius
2012-Sep-29 20:43 UTC
[R] Removing lower whisker in boxplot to see the effects of the high values
On Sep 29, 2012, at 12:46 PM, David Winsemius wrote:> > On Sep 29, 2012, at 12:09 PM, Meredith Ballard LaBeau wrote: > >> David: >> I set this up and it still seems to plot the same: >> >> maumnf_plot<-boxplot(log_loads~ind,data=nfmaum, horizontal=TRUE, notch=T, outline=FALSE, whisker=0, main="Maumee River Near Future Climate Scenarios", ylab="Log Load",xlab="Climate Scenarios") >> maumnf_plot$stats[-1,] (to remove the lower whiskers) >> bxp(maumnf_plot) >> >> this does not remove the whiskers....is there something I am missing in bxp? > > I said to replace the whisker value with the hinge value: > > maumnf_plot<-boxplot(log_loads~ind,data=nfmaum ) > # only need the data to get the stats > > maumnf_plot$stats[1,] <- maumnf_plot$stats[2,] > # Replaced whisker row with hinge row > # The graphics arguments to bxp need to be in the second call. > # They won't be carried over from the sats > > bxp(maumnf_plot, , horizontal=TRUE, notch=T, outline=FALSE, whisker=0, main="Maumee River Near Future Climate Scenarios", ylab="Log Load",xlab="Climate Scenarios")I do now notice that there is an extraneous comma in that call that will throw an error if allowed to persist.> > -- > David >> >> Thanks >> Meredith >> >> On Sat, Sep 29, 2012 at 1:46 PM, David Winsemius <dwinsemius at comcast.net> wrote: >> >> On Sep 29, 2012, at 10:23 AM, Meredith Ballard LaBeau wrote: >> >>> Good Afternoon- >>> I was wanting to alter the boxplot to remove the lower whisker, both the >>> whisker line and staple just on the lower end. Is there a way to do this? >>> As my code is currently: >>> boxplot(log_loads~ind,data=nfmaum, horizontal=TRUE, notch=T, outline=FALSE, >>> whisker=0, main="Maumee River Near Future Climate Scenarios", ylab="Log >>> Load",xlab="Climate Scenarios") >> >> If you altered the value in what is passed from `boxplot.stats` to `bxp` so the lower whisker value was the same as the lower hinge value The lower whisker would merge into the hinge. `boxplot` returns those stats-values invisibly, so you just assign to an object name, make your changes and pass back to bxp. >> >> >>> >>> I just want to better see the medians and high end tail. >>> >>> >> -- >> >> David Winsemius, MD >> Alameda, CA, USA >> >> >> >> >> -- >> Doctoral Candidate >> Department of Civil and Environmental Engineering >> Michigan Technological University >> >> > > David Winsemius, MD > Alameda, CA, USA > > > [[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.David Winsemius, MD Alameda, CA, USA