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?
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 at 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 >
Gabor Grothendieck
2005-Jul-14 23:41 UTC
[R] plot the number of replicates at the same point
See ?sunflowerplot for a graphic indication of the number of replications at each point.
Hi all, This is nowhere near as elegant as Deepayan's solution, but I read the spec as plotting symbols except where there were overlays. You are welcome to improve the following... Jim -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: count.overplot.R Url: https://stat.ethz.ch/pipermail/r-help/attachments/20050715/6250585e/count.overplot.pl