Hi Gina. I am not sure your normalization process does what you want, but just to get the code working, here is how it can be done:
# example data my.data <- data.frame(rnorm(100,3,4), rnorm(100,3,4)) bb<-function(dat) { (dat-min(dat))/(max(dat)-min(dat)) } dat1<-t(apply(my.data,1,bb)) Best, Tal On Wed, Aug 12, 2009 at 1:23 PM, Gina Liao <yi...@hotmail.com> wrote: > > bb<-function(normalize) > (dat[i,]-min(dat[i,]))/(max(dat[i,])-min(dat[i,]))> dat1<-apply(dat,1,bb) > -- ---------------------------------------------- My contact information: Tal Galili Phone number: 972-50-3373767 FaceBook: Tal Galili My Blogs: http://www.r-statistics.com/ http://www.talgalili.com http://www.biostatistics.co.il [[alternative HTML version deleted]] ______________________________________________ R-help@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.