2
$\begingroup$

Actually, I have this kind of table I want to summarize into a graphic in R (preferably with ggplot2). Where the first three columns are the possible combinations of three methods (where 0 is absence and 1 presence) and the three last ones are the number of elements for each three methods.

enter image description here

I tried to resume this table into a figure, actually I tried Venn diagram, upset plot but as you see I have different values for each method in a given combination.

I wondered if you know some graphics which I could use to have graphical representation of this table. Examples are more than welcome.

$\endgroup$
5
  • 1
    $\begingroup$ Your three columns on the right only have nonzero entries in rows where the corresponding one of the three columns on the left has a "1" entry. Is that correct? If so, then it would rather argue for three $2\times 2$ tables, than for your large one. $\endgroup$ Mar 22, 2021 at 14:50
  • 3
    $\begingroup$ I am extremely positive about graphics, but this seems a case where your table is as clear and as easy to think about as any graphic would be. $\endgroup$
    – Nick Cox
    Mar 22, 2021 at 14:51
  • $\begingroup$ @NickCox Actually, I was trying to resume this table because I would like to use it into scientific publication. If you think it is as clear as I expected, probably I am using it with features mentionned below $\endgroup$ Mar 22, 2021 at 15:04
  • $\begingroup$ @StephanKolassa If I well understand your comment, I do not want to consider the three method independently. Which I guess, it is the case if I use the approach you are proposing. If I am wrong, please clarify your comment with an example. $\endgroup$ Mar 22, 2021 at 15:11
  • $\begingroup$ It would be wrong to make a graphic out of this table. You should only do this when your story is 1000 words or more. $\endgroup$ Jul 11, 2022 at 19:41

2 Answers 2

1
$\begingroup$

As Nick Cox already said, it is already clear, but a possible addon might be a table with small graphics, for this, one can use formattable package with sparklines package

https://www.r-bloggers.com/2018/11/make-beautiful-tables-with-the-formattable-package/

Which gives us for example such a table with sparklines:

table

Possible sparklines could be: spark

$\endgroup$
3
  • 1
    $\begingroup$ Thanks for your reply. I did not know sparkline package, it is look like I can improve my table. However, do you know if it is produced through ggplot functions? Actually, I am producing my panel of figures with ggpubr package which is only-compatible with ggplot figures. $\endgroup$ Mar 22, 2021 at 15:07
  • $\begingroup$ The sparkline package can be seen as a standalone html widget: bart6114.github.io/sparklines and the sparklines itself base on jquery but the implementation is realtiveley easy as you can see $\endgroup$ Mar 22, 2021 at 18:37
  • $\begingroup$ In Tufte's parlance, this example with sparklines has a remarkably large Lie Factor! Would the package at least permit displaying all the plots on the same axes to enable accurate visual comparison? $\endgroup$
    – whuber
    Jul 11, 2022 at 19:37
0
$\begingroup$

I am not really sure if that makes it more readable, but maybe you could just create a figure with boxes? Each line could then represent a column of your table. In general, I would check if the order in your column is the most reader-friendly. I am not familiar with your work, so for me, it is a bit difficult to read 0 0 1, then 0 1 0 and then 0 1 1. I would probably expect 1 0 0 as the third position, perhaps that does not makes sense for your case.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.