[R] Use of Sappy and Tappy for Mathematical Calculation

arun smartpink111 at yahoo.com
Tue Jul 10 18:20:33 CEST 2012


Hi,

 dat1<-data.frame(ABC=c(12,24,30),XYZ=c(20,35,40))
 dat2<-as.matrix(dat1)
 #mean
 dat2mean<-apply(dat2,2,mean)
 dat2mean
  #   ABC      XYZ 
#22.00000 31.66667 
dat2sum<-apply(dat2,2,sum)
 dat2median<-apply(dat2,2,median)
 dat2max<-apply(dat2,2,max)
dat2min<-apply(dat2,2,min)

 dat2range<-apply(dat2,2,range)

dat2count<-apply(dat2,2,length)
dat2sd<-apply(dat2,2,sd)
dat2var<-apply(dat2,2,var)

A.K.



----- Original Message -----
From: Rantony <antony.akkara at ge.com>
To: r-help at r-project.org
Cc: 
Sent: Tuesday, July 10, 2012 6:16 AM
Subject: [R] Use of Sappy and Tappy for Mathematical Calculation

Hi,

i have a matrix like this,

ABC        XYZ    ......    .....   .....
-----         ------
12            20      ......    .....   .....
24            35      ......    .....   .....
30            40      ......    .....   .....

Here, i need to get 
                           Sum of each columns,
                           Mean of each columns, 
                           median of each columns,
                           mode of each columns, 
                           Standard deviation  of each columns, 
                           variance of each columns, 
                           range of each columns,
                           count of each columns,
                           max of each columns, 
                           min of each columns

Can i get output using sappy or tappy functions ? because there have alots
of records.

Could you please help me fast its kind of urgent !

- Thanks 
Antony 

--
View this message in context: http://r.789695.n4.nabble.com/Use-of-Sappy-and-Tappy-for-Mathematical-Calculation-tp4635969.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list