-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of
Ted.Harding at nessie.mcc.ac.uk
Sent: Wednesday, November 24, 2004 16:37 PM
To: R Help Mailing List
Subject: RE: [R] scatterplot of 100000 points and pdf file format
On 24-Nov-04 Prof Brian Ripley wrote:
On Wed, 24 Nov 2004 Ted.Harding at nessie.mcc.ac.uk wrote:
1. Multiply the data by some factor and then round the
results to an integer (to avoid problems in step 2).
Factor chosen so that the result of (4) below is
satisfactory.
2. Eliminate duplicates in the result of (1).
3. Divide by the factor you used in (1).
4. Plot the result; save plot to PDF.
As to how to do it in R: the critical step is (2),
which with so many points could be very heavy unless
done by a well-chosen procedure. I'm not expert enough
to advise about that, but no doubt others are.
unique will eat that for breakfast
x <- runif(1e6)
system.time(xx <- unique(round(x, 4)))
[1] 0.55 0.09 0.64 0.00 0.00
'unique' will eat x for breakfast, indeed, but will have some
trouble chewing (x,y).
xx <- data.frame(x=round(runif(1000000),4), y=round(runif(1000000),4))
system.time(xx2 <- unique(xx))