[R] Select varying LS digits in long numbers?

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Thu Sep 29 19:45:31 CEST 2005


Hi Folks,

I'm trying to find a neat solution to an apparently simple
problem, but one which turns out to be a bit more intricate
and tricky than one might expect.

Suppose I have numbers given to a large number of digits.
For example

  1234567021

where (though I don't know this beforehand) only the last
3 digits will be varying (and all 3 will vary).

What I want is, give a vector x of such numbers, to extract
the minimal set of final digits which will include the varying
digits (i.e. in this case the last 3 digits). And there may be
a decimal point somewhere along the line (though again I won't
know where, nor whether).

I can think of brute-force ways of doing this, but I'd like
a neat one!

Best wishes to all,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 29-Sep-05                                       Time: 18:45:26
------------------------------ XFMail ------------------------------




More information about the R-help mailing list