[R] Dotchart showing mean and median by group

David Winsemius dwinsemius at comcast.net
Thu May 10 11:06:32 CEST 2012


On May 10, 2012, at 5:03 AM, David Winsemius wrote:

>
> On May 10, 2012, at 2:24 AM, maxbre wrote:
>
>> hi all
>>
>> I have another question reated to the dotchart: is it possible by  
>> means of
>> par() to set a logaritmic scale?
>> If yes, how ? and if not, any alternative solution?
>
> Looking at the dotchart code it appears to me that the log parameter  
> to plot.window is hard-coded at "", i.e both scales are linear.  
> Testing with the xlog parameter to par does fail.  You can always  
> define a new dochart2 on the basis of that code.

Another alternative would be lattice (a simple mod to one of its  
examples shows it "works"):

dotplot(variety ~ yield | site, data = barley, groups = year,
         key = simpleKey(levels(barley$year), space = "right"),  
scales=list(x=list(log=TRUE)),
         xlab = "Barley Yield (bushels/acre) ",
         aspect=0.5, layout = c(1,6), ylab=NULL)
>

-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list