Re: [R] plot the number of replicates at the same point

From: Kerry Bush <kerryrekky_at_yahoo.com>
Date: Fri 15 Jul 2005 - 03:01:46 EST


Thank you for thinking about the problem for me. However, I have found that your method doesn't work at all.

You may test the following example:

x1=c(0.6,0.4,.4,.4,.2,.2,.2,0,0)
x2=c(0.4,.2,.4,.6,0,.2,.4,0,.2)
x1=rep(x1,4)
x2=rep(x2,4)

temp=data.frame(x1,x2)
temp1=table(temp)
plot(temp$x1,temp$x2,cex=0)
text(as.numeric(rownames(temp1)),
as.numeric(colnames(temp1)), temp1)

what I got here is not what I wanted. You may compare with
plot(x1,x2)

I actually want some plots similar to what SAS proc plot produced.

Does anybody have a clue of how to do this easily in R?

> You can do the following (don't know it this is the
> most efficient way but
> it works)
>
> temp<-read.table("your file to read the data",
> header=T)
> temp1<-table(temp)
> plot(temp$x, temp$y, cex=0)
> text(as.numeric(rownames(temp1)),
> as.numeric(colnames(temp1)), temp1)
>
> HTH
>
>
> On Wed, 13 Jul 2005, Kerry Bush wrote:
>
> > Dear R-helper,
> > I want to plot the following-like data:
> >
> > x y
> > 1 1
> > 1 1
> > 1 2
> > 1 3
> > 1 3
> > 1 4
> > ......
> >
> > In the plot that produced, I don't want to show
> the
> > usual circles or points. Instead, I want to show
> the
> > number of replicates at that point. e.g. at the
> > position of (1,1), there are 2 obsevations, so a
> > number '2' will be displayed in the plot.
> > Is my narrative clear? Is there a way to make the
> plot
> > in R?
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
> >
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jul 15 03:06:06 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:40 EST