[R] dot plot with several points for 2 categories

1Rnwb sbpurohit at gmail.com
Mon Jul 20 18:46:37 CEST 2009


I use  the long way, you might have to play around with my script to get is
correct. once you get it to work, you can add as many points to reflect,
median, percentile etc.

## generatiing vectors for Group1
a<-LMMP8[Self_T1D=="N"]
w <- a[!is.na(a)]
             length(w)

c<-mean(a, na.rm=TRUE)
c
n<-as.integer(length(w)/7)
n
n4<- length(w)-6*n
n4
###Generating vectors for T1D
b<-LMMP8[Self_T1D=="Y"]
x <- b[!is.na(b)]
             length(x)

d<-mean (b, na.rm=TRUE)
d
m<-as.integer(length(x)/7)
m
m4<- length(x)-6*m
m4

u<-append(w, x, after = length(w))
length(u)

x<-c(rep(1:6,n),rep(7,n4), rep(11:16,m),rep(17,m4))
length(x)
#####Plotting the data
plot(x,u, ylab="Log MMP8",pch=19,cex.lab=1.5,lty=2,cex=1.1,
cex.axis=1.25,xaxt="n")
points(4,c,pch=25,col="red",lwd=5)
points(14,d,pch=25,col="red",lwd=5)





jaregi wrote:
> 
> I'm trying to wean myself off the very limited capabilities of Excel and
> Oo. Currently, I am trying to make a plot showing several values for 2
> categories in a dot blot (see 
> http://www.nabble.com/file/p24538360/Picture%2B1.png Picture+1.png  except
> that the x axis should contain the category not a number, which was the
> only way to coax Excel into displaying a plot like this). I started
> working through some tutorials but the example didn't quite fit what I was
> looking for. The closest was the car and mpg example but it 1 value per
> name whereas I need several value per category. Does anybody know this of
> the top of your expert heads? This would be a great help. I already burned
> a few hours without getting closer to the solution..
> 
> Best, j
> 

-- 
View this message in context: http://www.nabble.com/dot-plot-with-several-points-for-2-categories-tp24538360p24573397.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list