friendly / VCDR

Visualizing categorical data with R
0 stars 0 forks source link

Fig 11.42: better labeling for multi-panel fourfold plot? #38

Closed friendly closed 9 years ago

friendly commented 9 years ago

Fig 11.42 uses mfcol() for a complex collection of fourfold plots, but the panel titles have the combinations of 3 variables represented, and overlap considerably. Is it possible to do this so that either the variable names are abbreviated or eliminated in the titles?

tab <- xtabs(visit ~ practitioner + place + gender + insurance + chronicf,
             data=nmes.long)
fourfold(tab, mfcol=c(4,4))
davidjohannesmeyer commented 9 years ago

2 Possible solutions:

  1. use a very large device so that the labels will not overlap - but when the drawing is rescaled, the text will become unreadable;
  2. use cotabplot(), e.g.:

cotabplot(tab, layout = c(4,4), panel = cotab_fourfold) cotabplot(tab, layout = c(2,8), panel = cotab_fourfold)

Of course, the labels use a lot of space.

Currently, the drawing of labels cannot be suppressed in fourfold(), but would that be an option anyway? How to identify the strata?

David

On 2015-04-19 19:57, Michael Friendly wrote:

|tab <- xtabs(visit ~ practitioner + place + gender + insurance + chronicf, data=nmes.long) fourfold(tab, mfcol=c(4,4))|

friendly commented 9 years ago

Neither solution works here, so I guess I may leave this as it is. The cotabplot idea could work, if cotabplot used vertical labels for the rows, as ggplot does with faceting. I'm not saying you should do this now, but it would be an improvement for cotabplot in the long term. (I don't want to add unessential tasks delaying VCDR.)

I wouldn't suppress the labels entirely, but another improvement would be to allow the label to be either varname : value (as now) or just value.

davidjohannesmeyer commented 9 years ago

I added an argument varnames= to rev. 806 which suppresses the variable names if set to FALSE. (That was trivial).

On 2015-04-20 15:51, Michael Friendly wrote:

Neither solution works here, so I guess I may leave this as it is. The |cotabplot| idea could work, if cotabplot used vertical labels for the rows, as ggplot does with faceting. I'm not saying you should do this now, but it would be an improvement for cotabplot in the long term. (I don't want to add unessential tasks delaying VCDR.)

I wouldn't suppress the labels entirely, but another improvement would be to allow the label to be either varname : value (as now) or just value.

— Reply to this email directly or view it on GitHub https://github.com/friendly/VCDR/issues/38#issuecomment-94456501.

FH-Prof. Priv.-Doz. Dr. David Meyer Institut für Wirtschaftsinformatik

Fachhochschule Technikum Wien Höchstädtplatz 5, 1200 Wien T: +43 1 333 40 77-394 F: +43 1 333 40 77-99 394 E: david.meyer@technikum-wien.at I: www.technikum-wien.at