At 12:02 PM 9/15/2007, Gerald wrote: >Hi All, > >There are a variety of functions that can be applied to a variable >(column) in a data frame: mean, min, max, sd, range, IQR, etc. > >I am aware of only two that work on the rows, using q1-q3 as example >variables: > >rowMeans(cbind(q1,q2,q3),na.rm=T) #mean of multiple variables >rowSums (cbind(q1,q2,q3),na.rm=T) #sum of multiple variables > >Can the standard column functions (listed in the first sentence) be >applied to rows, with the use of correct indexes to reference the >columns of interest? Or, must these summary functions be programmed >separately to work on a row?
Try using t() to transpose the matrix, and then apply the column function of interest. ================================================================ Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: [EMAIL PROTECTED] Least Cost Formulations, Ltd. URL: http://lcfltd.com/ 824 Timberlake Drive Tel: 757-467-0954 Virginia Beach, VA 23464-3239 Fax: 757-467-2947 "Vere scire est per causas scire" ______________________________________________ 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.