s-news
[Top] [All Lists]

Duplicate and Unique Data Frame Question

To: <s-news@lists.biostat.wustl.edu>
Subject: Duplicate and Unique Data Frame Question
From: "Overstreet, Jason" <joverstreet@hotwater.com>
Date: Fri, 7 Sep 2007 17:10:33 -0500
Thread-index: Acfxm+lO8vRvHRo5Qa6trpAWVkNFAw==
Thread-topic: Duplicate and Unique Data Frame Question

The following example is created for demonstrative purposes for unique and duplicated rows in a data frame.  Given the following command lines:


> x <- c("a", "a", "b", "b", "c", "c", "c","d","e","f")

> y <- c(1,2,3,4,5,6,7,8,9,10)

>

> xy<-data.frame(x,y)

> xy

   x  y

1  a  1

2  a  2

3  b  3

4  b  4

5  c  5

6  c  6

7  c  7

8  d  8

9  e  9

10 f 10

How does one create separate data frames for the duplicated rows ( lines 1 through 7 )  and the unique rows (lines 8 through 10)?  


Jason Overstreet

Statistician

ASQ: CRE, CQE

A.O. Smith

106 Adkisson Street

Ashland, TN 37015

Office: (615) 792-6253

Cell: (615) 495-6144

Fax: (615) 792-2121

Email: joverstreet@hotwater.com


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
<Prev in Thread] Current Thread [Next in Thread>