Here is the data:
df <- structure(list(country = c("Australia", "Australia", "Australia",
"South Korea", "South Korea", "South Korea"), parts = c("case_1",
"case_2", "non_case", "case_1", "case_2", "non_case"), values = c(1,
19, 80, 1, 29, 70)), row.names = c(NA, -6L), class = c("tbl_df",
"tbl", "data.frame"))
library(tidyverse)
library(waffle)
df %>% ggplot(aes(label = parts, values = values)) +
geom_pictogram(n_rows = 10, aes(color = parts),
family = 'fontawesome-webfont',
flip = TRUE,
size = 6,
show.legend = FALSE,
make_proportional = TRUE
) +
scale_label_pictogram(
name = "Confirmed cases",
values = c("male"),
) +
coord_equal() +theme_minimal() +
facet_wrap(~country, nrow = 2, strip.position = "top")
In the above code, I generated the following waffle chart. With make_proportional = TRUE and n_rows = 10, I expected to get 100 icons for each country, but instead got 99 for South Korea. Only way that I can fix this problem is to calculate all proportions first and using make_proportional = FALSE, but it will take some time. Also, I feel this is a little bit strange. It would be appreciated if anyone could help me with this.

There seems to be a weird rounding problem in the function of waffle. According to the
documentation, themake_proportionalargument does the following:It seems there goes something wrong with the rounding of the values. Here a demonstration using
as.integerwhere n2 shows what currently happens and n3 are the values that actually should happen:Created on 2022-10-16 with reprex v2.0.2
As you can see it should be like n3. So what you could do is checking if the difference between your values and n2 is bigger than 0 to add 1 to your values to get the desired result like this:
Created on 2022-10-16 with reprex v2.0.2