'PieDonut not showing donut labels

I have the following dataset:

enter image description here

I'm trying to make a simple PieDonut chart using webr (https://cardiomoon.github.io/webr/reference/PieDonut.html) as

PieDonut(dados, aes(status, group), ratioByGroup = FALSE, r0 = 0)

However, it does not return donut labels (C, NC, P, SP, ST), only the value represented by the sum of C+NC+P+SP+ST (110 for Ingresso and 56 for Egresso)

enter image description here

Warning messages: 1: In max(nchar(levels(df3$label))) : no non-missing arguments to max; returning -Inf 2: guides(<scale> = FALSE) is deprecated. Please use guides(<scale> = "none") instead. 3: guides(<scale> = FALSE) is deprecated. Please use guides(<scale> = "none") instead.

Any idea of what is happening?



Solution 1:[1]

Ok, so I worked around a bit and got to an answer:

#Adding a frequency count to each observation
dados$freq = 1

PD = dados %>% group_by(status, Categoria) %>% summarise(n = sum(freq))
print(PD)

enter image description here

#Then...
PieDonut(PD, aes(status, Categoria, count = n),
         r0 = 0,
         showRatioThreshold = 0.001,
         showPieName = F,
         title = "Some title here",
         ratioByGroup = F)

Thing is: I did some piedonuts before using the same package and I had no issues avoiding the count argument. Don't know what happened about that.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 hiperhiper