Skip to content

selection by two unique variables

3 messages · Ayyappa Chaturvedula, Bert Gunter, jim holtman

#
?tapply

?with is also useful here

as in (untested)
with(yourdataframe, tapply(lastpk, id, unique))

-- Bert

On Wed, May 2, 2012 at 7:58 AM, Ayyappa Chaturvedula
<ayyappach at gmail.com> wrote:

  
    
#
try this:
+
+  64050256 2010-09-18   275  2010-09-16
+
+  64050256 2010-09-19   277  2010-09-18
+
+  64050256 2010-09-20   272  2010-09-18
+
+  64050256 2010-09-21   277  2010-09-18", as.is = TRUE, header = TRUE)
+     a[1,, drop = FALSE]
+ })
id       wtdt  wt     lastpk
64050256.2010-09-16 64050256 2010-09-18 275 2010-09-16
64050256.2010-09-18 64050256 2010-09-19 277 2010-09-18

        
On Wed, May 2, 2012 at 11:23 AM, Bert Gunter <gunter.berton at gene.com> wrote: