4

An example from my data:

1 99
85 15
8 92
1 99
10 90
0 100

The problem is the last set of numbers: When there is a 0 included, waffle behaves like it's a 100. The zero seems to be ignored. Is there a way to prevent this?

Working: Green = 10, orange = 90

waffle(c(10, 90))

enter image description here

Not working: Green = 0, but its visualized as Green = 100. Every rectangle should be orange

waffle(c(0, 100))

enter image description here

Marcus Campbell
  • 2,746
  • 4
  • 22
  • 36
kabr
  • 1,249
  • 1
  • 12
  • 22
  • 2
    I am guessing it is picking a preset colour to plot, in first plot you have 2 categories, so start with green then red, in second one there is nothing to plot for the first one, so it picks green for the second one. Maybe you should supply colours manually. – zx8754 Apr 20 '16 at 09:00
  • I did, problem remains the same – kabr Apr 20 '16 at 09:26
  • Yes, I would say it is a bug, and noticed your bug report. @hrbrmstr is the author. – zx8754 Apr 20 '16 at 09:30

1 Answers1

2

Danke for finding this and filing the issue! Fixed in 0.6.0.9000:

gridExtra::grid.arrange(
  waffle(c(thing1=0, thing2=100), rows=5),  
  waffle(c(thing1=25, thing2=75), rows=5)
)

enter image description here

hrbrmstr
  • 77,368
  • 11
  • 139
  • 205