[R] Fwd: Using panel.grid in barchart

Christopher Jones c_jones at MIT.EDU
Sun Feb 8 18:27:54 CET 2009


I forgot to reply this to the list; my (apparently quite trivial)  
problem is solved.

Begin forwarded message:
>
> It just doesn't seem to do anything useful when I do it. If the goal  
> were to learn how not to annoy the syntax engine in R, I guess the  
> goal was accomplished, but not much beyond that.
>
> -- 
> David
>
> On Feb 8, 2009, at 11:25 AM, Christopher Jones wrote:
>
>>
>> On Feb 8, 2009, at 11:04 AM, David Winsemius wrote:
>>>>
>>>> > update(titan, panel = function(...) { panel.grid(h = 0,v = -1)  
>>>> panel.barchart(...)})
>>>
>>> Scanning that line makes me wonder if you are forgetting to  
>>> separate the individual panel calls with the appropriate separator  
>>> (";").
>>
>> This was the problem.  My oversight was assuming whitespace didn't  
>> matter between calls.  It helps with readability but I didn't  
>> realize it was required.  I was also able to use the newline as a  
>> separator:
>>
>> > barchart(Class ~ Freq | Age + Sex, data = as.data.frame(Titanic),  
>> groups=Survived, stack=TRUE, layout=c(4,1),  
>> auto.key=list(title="Survived", columns=2), scales=list(x="free"),  
>> panel = function(...) { panel.grid(h = 0, v = -1)  <--newline here
>> + panel.barchart(...) })    <--works fine
>>
>> The one-liner I posted earlier works with the ; as separator.   
>> Thanks.
>>
>>>
>>> My advice would be to spend a bit more time articulating your goals.
>>
>> Simple: to learn Lattice by copying examples and tweaking the  
>> options.  I can resume that now.
>> Thanks again,
>> Chris
>>
>>
>>
>>
>>
>

Chris Jones




More information about the R-help mailing list