3/12/11, Petr Savicky wrote:
From: Petr Savicky
Subject: Re: [R] Identifying unique pairs
To: r-help@r-project.org
Received: Saturday, March 12, 2011, 2:10 PM
On Sat, Mar 12, 2011 at 03:20:01AM -0800, Vincy Pyne wrote:
> Dear R helpers
>
> Suppose I have a data frame as given below
>
&
On Sat, Mar 12, 2011 at 03:20:01AM -0800, Vincy Pyne wrote:
> Dear R helpers
>
> Suppose I have a data frame as given below
>
> mydat = data.frame(x = c(1,1,1, 2, 2, 2, 2, 2, 5, 5, 6), y = c(10, 10, 10, 8,
> 8, 8, 7, 7, 2, 2, 4))
>
[...]
>
> unique(mydat$x) will give me 1, 2, 5, 6? i.e. 4 valu
Thanks sir for your reply. Unfortunately I couldn't figure out the solution.
Vincy
--- On Sat, 3/12/11, Dennis Murphy wrote:
From: Dennis Murphy
Subject: Re: [R] Identifying unique pairs
To: "Vincy Pyne"
Cc: r-help@r-project.org
Received: Saturday, March 12, 2011, 11:45 AM
Hi
Hi:
This problem came up the other day - see
http://stats.stackexchange.com/questions/7884/fast-ways-in-r-to-get-the-first-row-of-a-data-frame-grouped-by-an-identifier/7985#7985
Dennis
On Sat, Mar 12, 2011 at 3:20 AM, Vincy Pyne wrote:
> Dear R helpers
>
> Suppose I have a data frame as given
Dear R helpers
Suppose I have a data frame as given below
mydat = data.frame(x = c(1,1,1, 2, 2, 2, 2, 2, 5, 5, 6), y = c(10, 10, 10, 8,
8, 8, 7, 7, 2, 2, 4))
mydat
x y
1 1 10
2 1 10
3 1 10
4 2 8
5 2 8
6 2 8
7 2
5 matches
Mail list logo