Re: [R] Weighted violin chart

2021-04-15 Thread Mahmood Naderan-Tahan
org Subject: Re: [R] Weighted violin chart On 15/04/2021 11:07 a.m., Mahmood Naderan-Tahan wrote: > It seems that using weight in ggplot has no effect. Also, using weight > parameter in geom_violin results in an error. > > >> mydata > V1 V2 V3 > P1 73.6 5 R > P2 75.2

Re: [R] Weighted violin chart

2021-04-15 Thread Duncan Murdoch
10 10 5 Any idea to fix that? Regards, Mahmood From: Jeff Newmiller Sent: Thursday, April 15, 2021 4:13:10 PM To: r-help@r-project.org; Mahmood Naderan-Tahan; r-help@r-project.org Subject: Re: [R] Weighted violin chart N

Re: [R] Weighted violin chart

2021-04-15 Thread Mahmood Naderan-Tahan
___ >>From: Jeff Newmiller >>Sent: Thursday, April 15, 2021 4:13:10 PM >>To: r-help@r-project.org; Mahmood Naderan-Tahan; r-help@r-project.org >>Subject: Re: [R] Weighted violin chart >> >>Not strictly on topic on this list (ggplot2 is a contributed pa

Re: [R] Weighted violin chart

2021-04-15 Thread Jeff Newmiller
Not strictly on topic on this list (ggplot2 is a contributed package) but... ggplot(mydata, aes(x=V3, y=V1, weight=V2 )) + geom_violin(trim=FALSE) If you want to refer to variables in the data, they have to be listed in the mapping. On April 15, 2021 7:01:45 AM PDT, Mahmood Naderan-Tahan wrot

Re: [R] Weighted violin chart

2021-04-15 Thread Mahmood Naderan-Tahan
Hi again, As a follow up, does anybody know how to fix the following error? It seems that I can use a "weight" parameter in geom_violin, but I am able to figure out what is the problem with the following code. > library(ggplot2) > mydata <- read.csv('test.csv', header=T,row.names=1) > mydat

Re: [R] Weighted violin chart

2021-04-12 Thread Chris Evans
- Original Message - > From: "Mahmood Naderan-Tahan" > To: r-help@r-project.org > Sent: Monday, 12 April, 2021 21:01:18 > Subject: [R] Weighted violin chart > Hi, > > I would like to know if it is possible to plot a weighted violin chart with R. >

[R] Weighted violin chart

2021-04-12 Thread Mahmood Naderan-Tahan
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