Re: [R] Extracting data from dataframe with tied rows

2012-08-24 Thread William Dunlap
are wdunlap tibco.com > -Original Message- > From: Peter Ehlers [mailto:ehl...@ucalgary.ca] > Sent: Friday, August 24, 2012 10:51 AM > To: William Dunlap > Cc: Peter Alspach; rjb; r-help@r-project.org > Subject: Re: [R] Extracting data from dataframe with tied rows > >

Re: [R] Extracting data from dataframe with tied rows

2012-08-24 Thread Peter Ehlers
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peter Alspach Sent: Thursday, August 23, 2012 4:37 PM To: rjb; r-help@r-project.org Subject: Re: [R] Extracting data from dataframe with tied rows Tena koe John One way: johnData <

Re: [R] Extracting data from dataframe with tied rows

2012-08-24 Thread William Dunlap
t.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Peter Alspach > Sent: Thursday, August 23, 2012 4:37 PM > To: rjb; r-help@r-project.org > Subject: Re: [R] Extracting data from dataframe with tied rows > > Tena koe John > > One way: > > johnData <-

Re: [R] Extracting data from dataframe with tied rows

2012-08-23 Thread Peter Alspach
Tena koe John One way: johnData <- data.frame(id=rep(LETTERS[1:5],20), distance=rnorm(1:100, mean = 100), bearing=sample(1:360,100,replace=T), month=sample(1:12,100,replace=T)) johnAgg <- aggregate(johnData[,'distance'], johnData[,c('id','month')], max) names(johnAgg)[3] <- 'distance' merge(john