[R] bwplot puts the bars in the wrong place

Peter Ehlers ehlers at ucalgary.ca
Sat Apr 17 16:34:17 CEST 2010


Well, finally we have something that we can respond to.

Do note the following from the Posting Guide:

# No binary attachments except for PS, PDF, and some
image and archive formats (others are automatically
stripped off because they can contain malicious
software). Files in other formats and larger ones
should rather be put on the web and have only their
URLs posted. This way a reader has the option to
download them or not.

I also found this comment in one of your previous emails
on this topic a bit churlish:

"The difference between the calls  is either a bug, or
it should be in the documentation somewhere obvious.
I spent a week on this."

lattice is a large and complex package. A great deal
of effort has gone into producing this software.
You're an R beginner (as evidenced by some of your
code). Bugs are of course inevitable, but you should
do a lot more testing before claiming something to be
a bug. If you want to improve the documentation, I
know that valuable improvements will be gratefully
accepted by Deepayan. And do remember what you're
paying for this software.

Now, as to your plotting problem: Jun Shen pointed
you in the right direction; OnHour needs to be a factor.
But it also needs to have the levels in the appropriate
order. So do this:

  gdf$OnHour <- factor(gdf$OnHour, levels = 0:23)
  bwplot(tt ~ OnHour | Runway, gdf)

One last comment on the data you supply: the Posting
Guide asks you to provide *minimal* reproducible ...
Since only three variables are needed for your plot
question, there really is no need to give us 21 variables.

  -Peter Ehlers

On 2010-04-17 6:48, James Rome wrote:
> The data are at http://dl.dropbox.com/u/537118/gdf.zip
> On 4/17/2010 1:42 AM, Deepayan Sarkar wrote:
>
> On Fri, Apr 16, 2010 at 1:54 PM, James Rome<jamesrome at gmail.com>  wrote:
>
>> Dear R-Help,
>>
>> With the attached data set, I am still getting incorrect bwplots
>>
> None of your attachments came through (presumably because of the list
> filters), and we need the data to figure out what's happening. Either
> put the result of dput inline (if it's not too big), or put it up
> somewhere we can download from. Putting a .txt extension may also
> work.
>
> -Deepayan
>
>
>>> xyplot(gdf$tt~gdf$OnHour |gdf$Runway, data=gdf)     # Is correct
>>>
>>
>>> bwplot(gdf$tt~gdf$OnHour |gdf$Runway, data=gdf, horizontal=FALSE)   #
>>>
>> Puts the boxes on the wrong x-axis values
>> # look especially at 0 and 3. How do I fix this?
>>
>> What is happening?
>>
>> Thanks,
>> Jim Rome
>>
>>
>>
>> ______________________________________________
>> R-help at r-project.org 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.
>>
>>
>>
>
> ______________________________________________
> R-help at r-project.org 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.
>
>

-- 
Peter Ehlers
University of Calgary



More information about the R-help mailing list