Re: [R] how to create density plot in R with p value

2020-02-11 Thread Bert Gunter
I assume you mean: densityplot(~dat,data=tot, groups=type, panel = function(...){ panel.densityplot(...) panel.abline(v= -4) panel.text(-3.9, 0.35, "*") }, par.settings = list(superpose.line = list(col = c("blue","red"))), xlab="log2

Re: [R] how to create density plot in R with p value

2020-02-11 Thread Jim Lemon
Hi Ana, Okay, it's the lattice package. Try this: panel.abline(v=-4) panel.text(-3.9,0.35,"*") As I don't have your data I can't provide a complete example. Jim On Wed, Feb 12, 2020 at 8:50 AM Ana Marija wrote: > > Hi Jim > > > I tried your code and it didn't show me density curves. > > Howeve

Re: [R] how to create density plot in R with p value

2020-02-11 Thread Ana Marija
Hi Jim I tried your code and it didn't show me density curves. However I was able to do teh plot myself via: densityplot(~dat,data=tot, groups=type, par.settings = list(superpose.line = list(col = c("blue","red"))), xlab="log2 (variance)", plot.points=FALSE, a

Re: [R] how to create density plot in R with p value

2020-02-11 Thread Jim Lemon
Hi Ana, Your image didn't make it through (as usual). Try PNG or PDF format. Assumptions 1) You want to plot two lines using the _paired_ values of inter- and intra-individual variance. 2) The cases are in the same order in your data 3) You want to identify the two lines 4) You want to place text

Re: [R] how to create density plot in R with p value

2020-02-11 Thread John Kane
Please supply sample data in dput() format See ?dput. You might find these links helpful. http://adv-r.had.co.nz/Reproducibility.html http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example On Tue, 11 Feb 2020 at 15:07, Ana Marija wrote: > so I transformed my

Re: [R] how to create density plot in R with p value

2020-02-11 Thread Ana Marija
so I transformed my data from the previous email to look like this: > head(tot) dat type 1 -3.962 inter.individual.variance 2 -4.301 inter.individual.variance 3 -1.690 inter.individual.variance 4 -0.375 inter.individual.variance 5 1.816 inter.individual.variance 6 0.138