El lun, 05-03-2007 a las 22:16 -0800, Dylan Arena escribió: > So here is my question in a nutshell: > Does anyone have ideas for how I might efficiently process a matrix > like that returned by a call to combinations(n, r, rep=TRUE) to > determine the number of repetitions of each element in each row of the > matrix? If so, I'd love to hear them! > >
here is an answer in a nutshell: my.table <- combinations(3,3,rep=TRUE) ## one possibility is apply(my.table,1,table) ## or better, in plain table(my.table,row(my.table)) look at the help pages of ?table ?apply ?row > Thanks very much for your time, > Dylan Arena > (Statistics M.S. student) > that took probably one minute of my time... so never mind -- Dipl.-Biol. JR Ferrer Paris ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Laboratorio de Biología de Organismos --- Centro de Ecología Instituto Venezolano de Investigaciones Científicas (IVIC) Apdo. 21827, Caracas 1020-A República Bolivariana de Venezuela Tel: (+58-212) 504-1452 Fax: (+58-212) 504-1088 email: [EMAIL PROTECTED] clave-gpg: 2C260A95 ______________________________________________ R-help@stat.math.ethz.ch 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.