Re: [R] basic table statistics

2010-04-25 Thread Christos Argyropoulos
will give you a table with the 3 quartiles, the mean+/-sd latex(sumstat) (will give you a beautiful tex version) Read the help info of "summary.formula" to customize the table to your needs Christos > From: dwinsem...@comcast.net > To: deeeperso...@googlemail.com > Date: Sat,

Re: [R] basic table statistics

2010-04-24 Thread David Winsemius
On Apr 23, 2010, at 3:48 PM, Maxim wrote: I have a very simple question, but I'm obviously not able to solve the problem on my own. I have a data.frame like sample(c("A","B","C"),size=20,replace = T)->type rnorm(20)->value data.frame(ty=type,val=value)->test There must be some built in fun

Re: [R] basic table statistics

2010-04-24 Thread Walmes Zeviani
You can use fBasics package sample(c("A","B","C"),size=20,replace = T) -> type rnorm(20) -> value data.frame(ty=type,val=value) -> test require(fBasics) nam <- rownames(basicStats(test$val)) result <- do.call("cbind", with(test, tapply(val, ty, basicStats))) rownames(result) <- nam result Best

Re: [R] basic table statistics

2010-04-24 Thread Jim Lemon
On 04/24/2010 05:48 AM, Maxim wrote: Hi, I have a very simple question, but I'm obviously not able to solve the problem on my own. I have a data.frame like sample(c("A","B","C"),size=20,replace = T)->type rnorm(20)->value data.frame(ty=type,val=value)->test There must be some built in f

Re: [R] basic table statistics

2010-04-23 Thread Dimitri Liakhovitski
There might be some package. But you can also do something like: results<-tapply(test$val,test$ty,function(x){ out1<-as.data.frame(length(x)) out2<-as.data.frame(mean(x)) out3<-as.data.frame(median(x)) out4<-as.data.frame(sd(x)) out<-cbind(out1,out2,out3,out

[R] basic table statistics

2010-04-23 Thread Maxim
Hi, I have a very simple question, but I'm obviously not able to solve the problem on my own. I have a data.frame like sample(c("A","B","C"),size=20,replace = T)->type rnorm(20)->value data.frame(ty=type,val=value)->test There must be some built in functions, that will do some descriptive