[R] scatterplot of 100000 points and pdf file format

Austin, Matt maustin at amgen.com
Thu Nov 25 02:51:53 CET 2004



> -----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
> >> length(xx)
> > [1] 10001
> 
> '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))
[1] 14.23  0.06 14.34    NA    NA

The time does not seem too bad, depending on how many times it has to be
performed.
--Matt

Matt Austin
Statistician

Amgen 
One Amgen Center Drive
M/S 24-2-C
Thousand Oaks CA 93021
(805) 447 - 7431

> I still can't think of a neat way of doing that.
> 
> Best wishes,
> Ted.
> 
> 
> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
> Fax-to-email: +44 (0)870 094 0861  [NB: New number!]
> Date: 25-Nov-04                                       Time: 00:37:15
> ------------------------------ XFMail ------------------------------
> 
> ______________________________________________
> 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
>




More information about the R-help mailing list