[R] about the whisker in boxplot

Yihui Xie xieyihui at gmail.com
Fri Sep 19 06:29:01 CEST 2008


Hi, it seems you have posted the same question (the day before
yesterday?) in previous threads.

I think you may try 'bxp()' - just change the argument z as you wish
and pass it to bxp(). For example:

##
> x = 1:10
> par(mfrow = c(1, 2))
> (b = boxplot(x))      ## the default (min, .25quantile, median, .75quantile max), see $stats
$stats
     [,1]
[1,]  1.0
[2,]  3.0
[3,]  5.5
[4,]  8.0
[5,] 10.0
attr(,"class")
        1
"integer"

$n
[1] 10

$conf
         [,1]
[1,] 3.001801
[2,] 7.998199

$out
numeric(0)

$group
numeric(0)

$names
[1] "1"

## change the default to .05 and .95quantile
> b$stats[, 1] = quantile(x, prob = c(0.05, 0.25, 0.5,
+     0.75, 0.95))
> b
$stats
     [,1]
[1,] 1.45
[2,] 3.25
[3,] 5.50
[4,] 7.75
[5,] 9.55
attr(,"class")
        1
"integer"

$n
[1] 10

$conf
         [,1]
[1,] 3.001801
[2,] 7.998199

$out
numeric(0)

$group
numeric(0)

$names
[1] "1"

## as you wish...
> bxp(b, ylim = range(x))
##

HTH.

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
Mobile: +86-15810805877
Homepage: http://www.yihui.name
School of Statistics, Room 1037, Mingde Main Building,
Renmin University of China, Beijing, 100872, China


On Fri, Sep 19, 2008 at 1:17 AM, catherineLF <cathelf at hotmail.com> wrote:
>
> Hi, Dear R-users,
>
> I have a problem when I drawing a boxplot.  I want to extend the whisker to
> the 5% and the 95% quantiles and only show the most extreme outlier, like
> 0.01%  and 99.99% percentiles. What should I do?
>
> I saw something on boxplot.stat, but even I define the parameter in
> boxplot.stat, what I should do next? how to connect it to boxplot?
>
> Thank you very much!
>
> Catherine
>
> --
> View this message in context: http://www.nabble.com/about-the-whisker-in-boxplot-tp19557700p19557700.html
> Sent from the R help mailing list archive at Nabble.com.
>



More information about the R-help mailing list