Martin Maechler
2018-Jun-08 10:02 UTC
[R] verInd= and HorInd= arguments to pairs() function
>>>>> Martin Maechler >>>>> on Fri, 8 Jun 2018 11:13:24 +0200 writes:[..........] >> Thank you, Chris, for the report and >> Gerrit for your proposed fix !! >> >> It looks good to me, but I will test some more (also with >> 'row1attop=FALSE') before committing the bug fix. > and there, another change was needed: Instead of your > for (j in if (row1attop) verInd else rev(verInd)) > for (i in horInd) { > we do now need > for(j in verInd) > for(i in if(row1attop) horInd else rev(horInd)) { > and the difference is of course only relevant for the > non-default 'row1attop = FALSE' > (which some graphic experts argue to be clearly *better* than the default, > as only in that case, the upper and lower triangles of the > matrix are nicely "mirrors of each other", and that is also > the reason why lattice::splom() uses the equivalent of > 'row1attop=FALSE') > I will commit the change to R-devel today - and intend to port > to R-patched in time to make it into the upcoming R 3.5.1. Well, as I find, there are more bugs there, if you are using 'horInd' and 'verInd' creatively: In a nice pairs(), the axis ticks (and their labels (numbers)) are always "on the outside" of the scatterplot matrix, and nicely alternating. This is not the case unfortunately, when using horInd or verInd which are *not* of the form p1:p2 (p1 <= p2) ==> even more changes are needed to make these cases "nice", or should we *require* horInd and verInd to be of that form?? This would not be back-compatible, but than such cases have been "wrong" really in all versions of R anyway, *and* at least be reordering the matrix/data.frame columns, the restriction of (hor|ver)Ind = p1:p2 (p1 <= p2) would seem acceptable, would it ?
Gerrit Eichner
2018-Jun-08 10:55 UTC
[R] verInd= and HorInd= arguments to pairs() function
Am 08.06.2018 um 12:02 schrieb Martin Maechler:>>>>>> Martin Maechler >>>>>> on Fri, 8 Jun 2018 11:13:24 +0200 writes: > > [..........] > > >> Thank you, Chris, for the report and > >> Gerrit for your proposed fix !! > >> > >> It looks good to me, but I will test some more (also with > >> 'row1attop=FALSE') before committing the bug fix. > > > and there, another change was needed: Instead of your > > > for (j in if (row1attop) verInd else rev(verInd)) > > for (i in horInd) { > > > we do now need > > > for(j in verInd) > > for(i in if(row1attop) horInd else rev(horInd)) { > > > and the difference is of course only relevant for the > > non-default 'row1attop = FALSE' > > > (which some graphic experts argue to be clearly *better* than the default, > > as only in that case, the upper and lower triangles of the > > matrix are nicely "mirrors of each other", and that is also > > the reason why lattice::splom() uses the equivalent of > > 'row1attop=FALSE') > > > I will commit the change to R-devel today - and intend to port > > to R-patched in time to make it into the upcoming R 3.5.1. > > Well, as I find, there are more bugs there, if you are using > 'horInd' and 'verInd' creatively: > > In a nice pairs(), the axis ticks (and their labels (numbers)) > are always "on the outside" of the scatterplot matrix, and > nicely alternating. This is not the case unfortunately, when using > horInd or verInd which are *not* of the form p1:p2 (p1 <= p2) > > ==> even more changes are needed to make these cases "nice",Well, the *shown* axis ticks and labels do nicely alternate if (hor|ver)Ind = p1:p2 (p1 <= p2) is fulfilled, but not all of the axis ticks and labels, which one *might* wish to see, are currently drawn anyway ... I would consider changes which "heal" this as more interesting than solving this problem in full generality, i.e., in cases of creative use of (hor|ver)Ind. However, I don't think it's urgent, at all.> or should we *require* horInd and verInd to be of that form?? > > This would not be back-compatible, but than such cases have been > "wrong" really in all versions of R anyway, *and* at least be > reordering the matrix/data.frame columns, the restriction of > > (hor|ver)Ind = p1:p2 (p1 <= p2) > > would seem acceptable, would it ? >I could live very well with that requirement (while breaking back-compatibility), because from my point of view a "creative" use of 'horInd' and 'verInd' violating (hor|ver)Ind = p1:p2 (p1 <= p2) won't occur often. On the other hand, why forcing (hor|ver)Ind = p1:p2 (p1 <= p2)? If people violated it "they get what they deserve". ;-) Btw, 'horInd' and 'verInd' sort of exchange their meaning if row1attop = FALSE, but I this can be explained by the "work flow": First, (hor|ver)Ind are used to select the respective rows and columns from the full paris-plot, and then, row1attop is used when the results are drawn. I think this is sensible. Regards -- Gerrit
Martin Maechler
2018-Jun-08 15:31 UTC
[R] verInd= and HorInd= arguments to pairs() function
>>>>> Gerrit Eichner >>>>> on Fri, 8 Jun 2018 12:55:31 +0200 writes:> Am 08.06.2018 um 12:02 schrieb Martin Maechler: >>>>>>> Martin Maechler >>>>>>> on Fri, 8 Jun 2018 11:13:24 +0200 writes: >> >> [..........] >> >> >> Thank you, Chris, for the report and >> >> Gerrit for your proposed fix !! >> >> >> >> It looks good to me, but I will test some more (also with >> >> 'row1attop=FALSE') before committing the bug fix. >> >> > and there, another change was needed: Instead of your >> >> > for (j in if (row1attop) verInd else rev(verInd)) >> > for (i in horInd) { >> >> > we do now need >> >> > for(j in verInd) >> > for(i in if(row1attop) horInd else rev(horInd)) { >> >> > and the difference is of course only relevant for the >> > non-default 'row1attop = FALSE' >> >> > (which some graphic experts argue to be clearly *better* than the default, >> > as only in that case, the upper and lower triangles of the >> > matrix are nicely "mirrors of each other", and that is also >> > the reason why lattice::splom() uses the equivalent of >> > 'row1attop=FALSE') >> >> > I will commit the change to R-devel today - and intend to port >> > to R-patched in time to make it into the upcoming R 3.5.1. >> >> Well, as I find, there are more bugs there, if you are using >> 'horInd' and 'verInd' creatively: >> >> In a nice pairs(), the axis ticks (and their labels (numbers)) >> are always "on the outside" of the scatterplot matrix, and >> nicely alternating. This is not the case unfortunately, when using >> horInd or verInd which are *not* of the form p1:p2 (p1 <= p2) >> >> ==> even more changes are needed to make these cases "nice", > Well, the *shown* axis ticks and labels do nicely alternate if > (hor|ver)Ind = p1:p2 (p1 <= p2) is fulfilled, but not all of > the axis ticks and labels, which one *might* wish to see, are > currently drawn anyway ... I would consider changes which "heal" > this as more interesting than solving this problem in full > generality, i.e., in cases of creative use of (hor|ver)Ind. > However, I don't think it's urgent, at all. >> or should we *require* horInd and verInd to be of that form?? >> >> This would not be back-compatible, but than such cases have been >> "wrong" really in all versions of R anyway, *and* at least be >> reordering the matrix/data.frame columns, the restriction of >> >> (hor|ver)Ind = p1:p2 (p1 <= p2) >> >> would seem acceptable, would it ? >> > I could live very well with that requirement (while breaking > back-compatibility), because from my point of view a "creative" > use of 'horInd' and 'verInd' violating (hor|ver)Ind = p1:p2 > (p1 <= p2) won't occur often. > On the other hand, why forcing (hor|ver)Ind = p1:p2 (p1 <= p2)? > If people violated it "they get what they deserve". ;-) > Btw, 'horInd' and 'verInd' sort of exchange their meaning if > row1attop = FALSE, but I this can be explained by the "work flow": > First, (hor|ver)Ind are used to select the respective rows and > columns from the full paris-plot, and then, row1attop is used > when the results are drawn. I think this is sensible. Thank you; and yes indeed, and I was not going to change that. In fact, I've found a relatively nice solution now, which does *not* restrict the settings of '{hor,ver}Ind' and fixes all problems mentioned, quite back compatibly, and in some sense perfectly labeling the axes. ==> Committed to R-devel svn c74871 a few minutes ago. Martin