Thank you Jim !

I made a little change in the script when assigning the median values - and
it works ! thank you very much !

x_median<-median(x,na.rm=T)
y_median<-median(y,na.rm=T)
x<-x[x<10]
y<-y[y<10]
xy_box<-boxplot(list(x,y),plot=FALSE)
xy_box$stats[3,1]<-x_median
xy_box$stats[3,2]<-y_median
bxp(xy_box)


On Fri, Feb 14, 2014 at 2:13 AM, Jim Lemon <jim@bitwrit.com.au> wrote:

> On 02/14/2014 08:48 PM, Bogdan Tanasa wrote:
>
>> Dear Jim,
>>
>> one more question please : how could I plot in this way 2 boxplots - eg
>> - bxp(x_box, y_box) or boxplot(x_box, y_box) do not work ... thanks !
>>
>> x_median<-median(x,na.rm=T)
>> x_box<-boxplot(x,plot=FALSE)
>> # drop the outliers
>> x<-x[x<10]
>> # get the boxplot stats for the reduced data
>> x_box<-boxplot(x,plot=FALSE)
>> # put the old median back in
>> x_box$stats[3]<-x_median
>> bxp(x_box)
>>
>> y_median<-median(y,na.rm=T)
>> y_box<-boxplot(y,plot=FALSE)
>> # drop the outliers
>> y<-y[y<10]
>> # get the boxplot stats for the reduced data
>> y_box<-boxplot(y,plot=FALSE)
>> # put the old median back in
>> y_box$stats[3]<-y_median
>> bxp(y_box)
>>
>> bxp(x_box, y_box)
>>
>>
>>  Try this (untested):
>
> x_median<-median(x,na.rm=T)
> y_median<-median(y,na.rm=T)
> x<-x[x<10]
> y<-y[y<10]
> xy_box<-boxplot(list(x,y),plot=FALSE)
> xy_box$stats[[1]][3]<-x_median
> xy_box$stats[[2]][3]<-y_median
> bxp(xy_box)
>
> Jim
>

	[[alternative HTML version deleted]]


