OpenRepGrid icon indicating copy to clipboard operation
OpenRepGrid copied to clipboard

Strange behaviour when working with clusters

Open weidenfreak opened this issue 10 years ago • 3 comments

Hi,

I think I encountered a bug in the cluster algorithm. I have a grid like the one shown in the screenshot below:

screen shot 2015-05-10 at 12 39 02

When I plot a normal bertin everything is fine. But if a want to draw a clustered version (either with cluster or bertinCluster) one of the constructs ("trustworthy - mysterious") (no kidding...) disappears and instead the construct "passive - interactive" appears twice but one time in a converted form. screen shot 2015-05-10 at 12 54 34

If I remove the "passive - interactive" construct then the "trustworthy - mysterious" appears again and everything works as expected.

Here's a gist with the file I'm using: https://gist.github.com/weidenfreak/5b2f3c7f7fb599d4ec6c

weidenfreak avatar May 10 '15 10:05 weidenfreak

Well, yes that is indeed a "mysterious" bug :smile:

markheckmann avatar May 11 '15 20:05 markheckmann

There is a problem in the internal OpenRepGrid:::align function. I always had doubts the quick-and-dirty approach I used in it was 100% sound. But now, due to the structure of your data, I can see that it is not. Unfortunately, there is no quick fix and I need to dig into into when I have more time.

Note, that the results turn out okay, if you slightly modify one cell in the data, e.g. x[1, 1] <- 2. If you tolerate this slight change before clustering (it won't change the structure too much I suppose), this may server as a quick-and-dirty work-around.

markheckmann avatar May 12 '15 08:05 markheckmann

No worries! I ended up clustering my data slightly different so it doesn't influence my work. It only seems to happen in very specific cases so I thought it would be helpful to report the bug with my initial data anyway.

Thanks for looking into it so quickly!

weidenfreak avatar May 12 '15 12:05 weidenfreak

Fixed in 5beb5ae9ce48042f1ff8625239c8b3d64a7eab8b

bertinCluster(x)

Image

markheckmann avatar May 08 '25 15:05 markheckmann