Suppress horizontal mean line in beanplot()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Suppress horizontal mean line in beanplot()

Samuel Knapp-2
Hi,

I would like to use the beanplot() function from the beanplot package.
Unfortunately, I can't find out how to suppress the dashed horizontal
line, that shows the overall mean.

In the help I've found the argument "overallline", but it only allows
for "mean" or "median" .

I have tried overallline = F, overallline="n", and overallline="", but
without success.

Strangely, I could also not find any suggestions on the internet.

Does anybody know how to do this?

Thanks,

Samuel

## Example code using the dataset InsectSprays from datasets package

library(beanplot)

beanplot(count ~ spray, data = InsectSprays)

# How to remove the dashed horizonal line?



--
Samuel Knapp

Lehrstuhl für Pflanzenernährung
Technische Universität München
(Chair of Plant Nutrition
Technical University of Munich)

Emil-Ramann-Strasse 2
D-85354 Freising

Tel. +49 8161 71-3578
[hidden email]
www.researchgate.net/profile/Samuel_Knapp

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: [FORGED] Suppress horizontal mean line in beanplot()

Paul Murrell-2
Hi

Does this do the trick ... ?

library(beanplot)
beanplot(count ~ spray, data = InsectSprays)

library(gridGraphics)
grid.echo()
grid.remove("abline", grep=TRUE)

Paul

On 14/02/18 07:31, Samuel Knapp wrote:

> Hi,
>
> I would like to use the beanplot() function from the beanplot package.
> Unfortunately, I can't find out how to suppress the dashed horizontal
> line, that shows the overall mean.
>
> In the help I've found the argument "overallline", but it only allows
> for "mean" or "median" .
>
> I have tried overallline = F, overallline="n", and overallline="", but
> without success.
>
> Strangely, I could also not find any suggestions on the internet.
>
> Does anybody know how to do this?
>
> Thanks,
>
> Samuel
>
> ## Example code using the dataset InsectSprays from datasets package
>
> library(beanplot)
>
> beanplot(count ~ spray, data = InsectSprays)
>
> # How to remove the dashed horizonal line?
>
>
>

--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[hidden email]
http://www.stat.auckland.ac.nz/~paul/

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: Suppress horizontal mean line in beanplot()

R help mailing list-2
In reply to this post by Samuel Knapp-2
hi, 

Check this 

beanplot(count ~ spray, data = InsectSprays, what = c(FALSE, TRUE, TRUE, TRUE))

From R function help : 
what :  a vector of four booleans describing what to plot. In the following order, these booleans stand for the total average line, the beans, the bean average, and the beanlines. For example, what=c(0,0,0,1) produces a stripchart


ggplot can be helpful

library(ggplot2)
p <- ggplot(InsectSprays, aes(factor(spray), count, fill=factor(spray) ))+ geom_violin()
print(p)

Regards.............
Tanvir Ahamed
Stockholm, Sweden     |  [hidden email]






On Tuesday, February 13, 2018, 7:32:22 PM GMT+1, Samuel Knapp <[hidden email]> wrote:





Hi,

I would like to use the beanplot() function from the beanplot package.
Unfortunately, I can't find out how to suppress the dashed horizontal
line, that shows the overall mean.

In the help I've found the argument "overallline", but it only allows
for "mean" or "median" .

I have tried overallline = F, overallline="n", and overallline="", but
without success.

Strangely, I could also not find any suggestions on the internet.

Does anybody know how to do this?

Thanks,

Samuel

## Example code using the dataset InsectSprays from datasets package

library(beanplot)

beanplot(count ~ spray, data = InsectSprays)

# How to remove the dashed horizonal line?



--
Samuel Knapp

Lehrstuhl für Pflanzenernährung
Technische Universität München
(Chair of Plant Nutrition
Technical University of Munich)

Emil-Ramann-Strasse 2
D-85354 Freising

Tel. +49 8161 71-3578   
[hidden email]
www.researchgate.net/profile/Samuel_Knapp

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: Suppress horizontal mean line in beanplot()

Bert Gunter-2
In reply to this post by Samuel Knapp-2
The package docs seem to provide your answer -- you just need to read them
more carefully:
See the "what" argument of ?beanplot.
Setting the first entry of the vector to 0 would seem to suppress the
overall mean.

Apologies if I've misread/misinterpreted.


Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Tue, Feb 13, 2018 at 10:31 AM, Samuel Knapp <[hidden email]> wrote:

> Hi,
>
> I would like to use the beanplot() function from the beanplot package.
> Unfortunately, I can't find out how to suppress the dashed horizontal line,
> that shows the overall mean.
>
> In the help I've found the argument "overallline", but it only allows for
> "mean" or "median" .
>
> I have tried overallline = F, overallline="n", and overallline="", but
> without success.
>
> Strangely, I could also not find any suggestions on the internet.
>
> Does anybody know how to do this?
>
> Thanks,
>
> Samuel
>
> ## Example code using the dataset InsectSprays from datasets package
>
> library(beanplot)
>
> beanplot(count ~ spray, data = InsectSprays)
>
> # How to remove the dashed horizonal line?
>
>
>
> --
> Samuel Knapp
>
> Lehrstuhl für Pflanzenernährung
> Technische Universität München
> (Chair of Plant Nutrition
> Technical University of Munich)
>
> Emil-Ramann-Strasse 2
> D-85354 Freising
>
> Tel. +49 8161 71-3578
> [hidden email]
> www.researchgate.net/profile/Samuel_Knapp
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posti
> ng-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.