Skip to content
Prev 387817 / 398502 Next

Weighted violin chart

It seems that using weight in ggplot has no effect. Also, using weight parameter in geom_violin results in an error.
V1 V2 V3
P1 73.6  5  R
P2 75.2  5  R
P3  6.5 60  R
P4 41.4 15  C
P5  5.4  5  C
P6 18.8 10  C
In the code above, there is no difference between the two charts.
Also, the following code ends up in an error
Error: Aesthetics must be either length 1 or the same as the data (1024): weight
Run `rlang::last_error()` to see where the error occurred.
[1] 50 20  5 10 10  5


Any idea to fix that?


Regards,
Mahmood


________________________________
--
Sent from my phone. Please excuse my brevity.