Re: [R] about plotting a special case

2017-07-13 Thread Jim Lemon
If you want colors mapped to the _values_ in DF1$C, there are a number of ways to do it: Color_unq<-color.scale(DF1$C,c(1,0),c(0,0,c(0,1)) This will produce colors from the lowest values (red) through the highest (blue). See the help page for color.scale to get different colors. With this you

Re: [R] about plotting a special case

2017-07-12 Thread Jim Lemon
values A and B have different ranges. Therefore you would want horizontal error bars for the B mean. The dispersion function doesn't do horizontal error bars, so you can use plotCI also in plotrix. Here is an example with two databases: DF2<-read.table(text="A B C 62 22 54 69 24 55

Re: [R] about plotting a special case

2017-07-12 Thread lily li
Thanks, Jim. The code works, but I don't understand why you use q1090 <- quantile(DF1$B, probs=c()), rather than DF1$A? Also, how to add a legend for both points DF1 and DF2? On Wed, Jul 12, 2017 at 8:25 PM, Jim Lemon wrote: > Hi lily, > Here is the first plot: > >

Re: [R] about plotting a special case

2017-07-12 Thread Jim Lemon
Hi lily, Here is the first plot: plot(DF1$A,DF1$B,pch=19,col="red") meanA<-mean(DF1$A) meanB<-mean(DF1$B) points(meanA,meanB,pch=18,col="red") q1090<-quantile(DF1$B,probs=c(0.1,0.9)) library(plotrix) dispersion(meanA,meanB,q1090[2],q1090[1], intervals=FALSE,col="red") The same code will work

[R] about plotting a special case

2017-07-12 Thread lily li
Hi R users, I have a question about plotting. There is the dataframe below, while each row represents a record. If I want to plot on a A-B plot, i.e., x-axis represents A, while y-axis represents B values. However, I want to plot the mean value from records 1-10 as one point, while the 10th and