Re: [R] score counts in an aggregate function

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 11:16 AM, KDT wrote: Thanks Ista Works well You might also get further value from reviewing the various describe functions (there must be 5 or six packages with different versions). The Hmisc::descibe works very well for me and would have given you tabular counts f

Re: [R] score counts in an aggregate function

2010-04-16 Thread KDT
Thanks Ista Works well Trevor -- View this message in context: http://n4.nabble.com/score-counts-in-an-aggregate-function-tp2007152p2011057.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://st

Re: [R] score counts in an aggregate function

2010-04-16 Thread Ista Zahn
Hi Trever, You can do it like this: count <- function(x) { length(na.omit(x)) } counts <- data.frame(aggregate(mydata[,4:5],by=list(mydata$userid),FUN="count")) -Ista On Fri, Apr 16, 2010 at 10:35 AM, KDT wrote: > > Dear R-Users, > I have a big data set "mydata" with repeated observation an

[R] score counts in an aggregate function

2010-04-16 Thread Kadengye Trevor
Dear r-list, I have a big data set "mydata" with repeated observation and some missing values. It looks like the format below: userid sex item score1 score2 1 01 1 1 1 02 0 1 1 03 NA 1 1 04 1 0 2

[R] score counts in an aggregate function

2010-04-16 Thread KDT
Dear R-Users, I have a big data set "mydata" with repeated observation and some missing values. It looks like the format below: userid sex item score1 score2 1 01 1 1 1 02 0 1 1 03 NA 1 1 04 1 0 2