[R] CircStats reveals underlying R bug?
jc at or.psychology.dal.ca
Wed Nov 12 14:01:31 CET 2003
On Nov 12, 2003, at 7:04 AM, Peter Dalgaard wrote:
> John Christie <jc at or.psychology.dal.ca> writes:
>> circ.plot in CircStats under R 1.8.0 yields incorrect plots (easily
>> compare hist() and rose.diag()). However, the code in circ.plot has
>> not changed. Has anyone tracked this down yet?
> Could you supply a directly runnable example, please?
Actually, in making something concise and runnable I found the problem.
It is undocumented that circ.plot does not handle negative angles
while rose.diag does. I think that should be called a bug in
circ,plot. It seems to me the code of these two should be merged
anyway to avoid future errors. rose.diag can do a circ.plot type
diagram (but you always get the rose as well).
So, a simple example is.
circ.plot(x, bins=18, stack=T, shrink=2)
rose.diag(x, bins=18, pts=T, shrink=2)
# everything should look OK up until you try comparing the next two
circ.plot(-x, bins=18, stack=T, shrink=2)
rose.diag(-x, bins=18, pts=T, shrink=2)
More information about the R-help