[R] Weighted violin chart

Mahmood Naderan-Tahan m@hmood@n@der@n @end|ng |rom ugent@be
Mon Apr 12 22:01:18 CEST 2021


Hi,

I would like to know if it is possible to plot a weighted violin chart with R. Currently, I have


> library(ggplot2)
> mydata <- read.csv('test.csv', header=T,row.names=1)
> mydata
     V1 V2 V3
P1 73.6 50  R
P2 75.2 20  R
P3  6.5  5  R
P4 41.4 10  C
P5  5.4 10  C
P6 18.8  5  C
> p <- ggplot(mydata, aes(x=V3, y=V1)) + geom_violin(trim=FALSE)
> p + geom_dotplot(binaxis='y', stackdir='center', dotsize=1)

I would like to use V2 as the weight vector. Any idea about that?



Regards,
Mahmood

	[[alternative HTML version deleted]]



More information about the R-help mailing list