[R] Boxplot problem
Peter Ehlers
ehlers at ucalgary.ca
Wed Mar 9 14:57:30 CET 2011
On 2011-03-09 00:17, Lao Meng wrote:
> No,even there's only one observation,boxplot can still be drawn.
>
> x<-1
> boxplot(x)
>
> or
> x<-1:3
> boxplot(x)
> ...
Well, yes, it *can* be drawn. But it shouldn't be.
A boxplot based on fewer than, say, 10 values is
just nonsense. Even 10 is pretty dubious.
Anyway, it seems that the OP needs to study the
difference between a boxplot and a barplot.
Peter Ehlers
>
>
>
>
> 2011/3/9 Dennis Murphy<djmuser at gmail.com>
>
>> Hi:
>>
>> A box plot is based on a five number summary, so you need at a minimum five
>> observations (and preferably at least twice that) to make a box plot a
>> viable summary measure for a continuous variable. Consider other graphical
>> summaries for these data - perhaps a strip chart or a simple scatterplot.
>>
>> HTH,
>> Dennis
>>
>> On Tue, Mar 8, 2011 at 9:26 PM, Gaurav Kumar<gaurav at gauravkumar.org>
>> wrote:
>>
>>> Dear R-user,
>>>
>>> I'm facing problem to draw boxplot. I can draw my
>>> boxplot but the space option is not working for me. I've no clues where
>>> i'm doing wrong
>>> my data is as matrix as shown below:
>>> [,1] [,2]
>>> [1,] 98 60
>>> [2,] 96 70
>>> [3,] 95 80
>>>
>>> and i'm plotting as
>>> barplot(height=c(data[1,],data[2,],data[3,]),
>>> beside=TRUE,
>>> space=c(.1,1),
>>> border="black",
>>> col=c("blue","red") )
>>>
>>> Please help me where i'm doing wrong or some known issue is there with
>>> boxplot.
>>>
>>> Thanks in advance.
>>>
>>> Gaurav Kumar
>>> www.gauravkumar.org
>>>
>>> PhD Student, Chemistry and Biomolecular Sciences, Macquarie , Sydney,
>>> Australia.
>>> MS (Computational Biology), NCBS-TIFR, Bangalore, India.
>>>
>>>
More information about the R-help
mailing list