boxplot width

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

boxplot width

nana
Hi everyone,
I made this set of boxplots that would show me the widths of some sites broken up by some chromosome, but I don't know how to make it indicate the number of data points that created the boxplot.
How do I do that?

boxplot(data$site~data$chr,varwidth='TRUE')


Reply | Threaded
Open this post in threaded view
|

Re: boxplot width

Tal Galili
Does:

boxplot(data$site~data$chr, varwidth=TRUE)

(notice I removed the ' '  from the 'TRUE')

Work ?



----------------Contact
Details:-------------------------------------------------------
Contact me: [hidden email] |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------




On Thu, Jun 24, 2010 at 2:45 PM, nana <[hidden email]> wrote:

> boxplot(data$site~data$chr,varwidth='TRUE')
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: boxplot width

nana
it works with the 'TRUE' as well but this only shows me the boxplots width; it doesn't show me the number of data points used though.. This is what I can't figure out
Reply | Threaded
Open this post in threaded view
|

Re: boxplot width

David Winsemius
In reply to this post by nana

On Jun 24, 2010, at 7:45 AM, nana wrote:

>
> Hi everyone,
> I made this set of boxplots that would show me the widths of some  
> sites
> broken up by some chromosome, but I don't know how to make it  
> indicate the
> number of data points that created the boxplot.
> How do I do that?
>
> boxplot(data$site~data$chr,varwidth='TRUE')
>
?boxplot
... read the Value section
?text


>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/boxplot-width-tp2266805p2266805.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: boxplot width

Hrishi Mittal
nana,

If you save the boxplot as an R object, you can access various parameters of
the resulting plot. Since we don't have your data, I'll give you an example
with the preloaded ToothGrowth dataset:

ToothGrowth<-y
b<-boxplot(y$len~y$dose,xaxt="n")

Now, if you type b at the R prompt, you will see that b$n contains the
number of points you are looking for.

So let's say you want to show those numbers on the X axis, you can do:

axis(1,at=1:length(b$names),labels=paste(b$names,"\n(n=",b$n,")",sep=""))


On Thu, Jun 24, 2010 at 2:47 PM, David Winsemius <[hidden email]>wrote:

>
> On Jun 24, 2010, at 7:45 AM, nana wrote:
>
>
>> Hi everyone,
>> I made this set of boxplots that would show me the widths of some sites
>> broken up by some chromosome, but I don't know how to make it indicate the
>> number of data points that created the boxplot.
>> How do I do that?
>>
>> boxplot(data$site~data$chr,varwidth='TRUE')
>>
>>  ?boxplot
> ... read the Value section
> ?text
>
>
>
>
>>
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/boxplot-width-tp2266805p2266805.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> [hidden email] 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.
>>
>
> ______________________________________________
> [hidden email] 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]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: boxplot width

PIKAL Petr
In reply to this post by nana
Hi

[hidden email] napsal dne 24.06.2010 15:18:39:

>
> it works with the 'TRUE' as well but this only shows me the boxplots
width;
> it doesn't show me the number of data points used though.. This is what
I
> can't figure out

Save your boxplot call to same object

bbb <- boxplot(whatever, varwidth=TRUE)

and look to list item n

bbb$n

Regards
Petr




> --
> View this message in context:
http://r.789695.n4.nabble.com/boxplot-width-
> tp2266805p2266932.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: boxplot width

nana
In reply to this post by Hrishi Mittal
Thank you. It worked.
Regards