Re: [R] identify duplicate entries in data frame and calculate mean

2016-05-24 Thread Matthew
tate Department of Social and Health Services -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Matthew Sent: Tuesday, May 24, 2016 12:47 PM To: r-help@r-project.org Subject: [R] identify duplicate entries in data frame and calculate mean I have a data f

Re: [R] identify duplicate entries in data frame and calculate mean

2016-05-24 Thread Matthew
Thanks, Tom. I was making a mistake looking at your example and that's what my problem was. Cool answer, works great. Thank you very much. Matthew On 5/24/2016 4:23 PM, Tom Wright wrote: > Don't see that as being a big problem. If your data grows then dplyr > supports connections to external

Re: [R] identify duplicate entries in data frame and calculate mean

2016-05-24 Thread Tom Wright
Don't see that as being a big problem. If your data grows then dplyr supports connections to external databases. Alternately if you just want a mean, most databases can do that directly in SQL. On Tue, May 24, 2016 at 4:17 PM, Matthew wrote: > Thank you very

Re: [R] identify duplicate entries in data frame and calculate mean

2016-05-24 Thread Matthew
Thank you very much, Tom. This gets me thinking in the right direction. One thing I should have mentioned that I did not is that the number of rows in the data frame will be a little over 40,000 rows. On 5/24/2016 4:08 PM, Tom Wright wrote: > Using dplyr > > $ library(dplyr) > $

Re: [R] identify duplicate entries in data frame and calculate mean

2016-05-24 Thread Nordlund, Dan (DSHS/RDA)
Of Matthew > Sent: Tuesday, May 24, 2016 12:47 PM > To: r-help@r-project.org > Subject: [R] identify duplicate entries in data frame and calculate mean > > I have a data frame with 10 columns. > In the last column is an alphaneumaric identifier. > For most rows, this alp

Re: [R] identify duplicate entries in data frame and calculate mean

2016-05-24 Thread Tom Wright
Using dplyr $ library(dplyr) $ x<-data.frame(Length=c(321,350,340,180,198), ID=c(rep('A234',3),'B123','B225') ) $ x %>% group_by(ID) %>% summarise(m=mean(Length)) On Tue, May 24, 2016 at 3:46 PM, Matthew wrote: > I have a data frame

[R] identify duplicate entries in data frame and calculate mean

2016-05-24 Thread Matthew
I have a data frame with 10 columns. In the last column is an alphaneumaric identifier. For most rows, this alphaneumaric identifier is unique to the file, however some of these alphanemeric idenitifiers occur in duplicate, triplicate or more. When they do occur more than once they are in