[R] elimination of multiple rows

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Thu Jul 18 09:04:22 CEST 2002


unique() has a method for data frames that will do this (although
your example and description differ: your example is not `consecutive').

I don't know `Pearl' either, but suspect you meant PERL.

On Thu, 18 Jul 2002, Christian Hoffmann wrote:

> Hi all,
>
> Excuse me for posting a question which may not be true R.
>
> I want to process a text file so that the resulting file contains only one
> of possibly multiple consecutive rows. Example (the row numbers do not
> belong to the file):
>
> (1) a b c d
> (2) a b c d
> (3) A b c d
> (4) A b c d
> (5) A b c d
> (6) a b c d
> (7) a b c D
> ..
>
> resulting in:
>
> (1) a b c d
> (3) A b c d
> (6) a b c d
> (7) a b c D
> ..
>
> (6) could be disposed of also by first sorting the original file.
>
> Does anybody have a script ready, preferably in Pearl? I do not know Pearl
> well enough to write it myself.
>
> Thanks for your help.
> --christian
>
> Dr.sc.math.Christian W. Hoffmann
> Mathematics and Statistical Computing
> Landscape Dynamics and Spatial Development
> Swiss Federal Research Institute WSL
> Zuercherstrasse 111
> CH-8903 Birmensdorf, Switzerland
> phone: ++41-1-739 22 77    fax: ++41-1-739 22 15
> e-mail: christian.hoffmann at wsl.ch
> www: http://www.wsl.ch/staff/christian.hoffmann/
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list