Dear Contributors: I have the next vector: "Z" 526 723 110 1110 34 778 614 249 14 I want to generate a vector containing the ratios of all the values versus all the values of the z vector. I mean a vector containing the values of 526/723, 526/110, and so on, 723/723, 723/110, and so on, and so on. Is this doable in a simple way?? Thanks in advance again, Juan Pablo Fededa
See ?outer outer(Z, Z, function(x,y) x/y) Gabor On Thu, Jan 17, 2008 at 01:24:33PM -0300, Juan Pablo Fededa wrote:> Dear Contributors: > > I have the next vector: > > "Z" > > 526 > 723 > 110 > 1110 > 34 > 778 > 614 > 249 > 14 > > I want to generate a vector containing the ratios of all the values > versus all the values of the z vector. I mean a vector containing the > values of 526/723, 526/110, and so on, 723/723, 723/110, and so on, > and so on. > Is this doable in a simple way?? > Thanks in advance again, > > > > Juan Pablo Fededa > > ______________________________________________ > 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.-- Csardi Gabor <csardi at rmki.kfki.hu> UNIL DGM
Dear Contributors: I have the next vector: "Z" z = (526, 0.1, 110, 0.2, 34, 0.4, 614, 0.5, 1, 14, 15) I want to generate a vector containing the values higher than 1 corresponding to the z vector, wich in this case will mean to generate the next vector: (526, 110, 34, 614, 14, 15) If you have any clue on how to do that, I will be very glad to hear it!!!!!! Thanks in advance again, [[alternative HTML version deleted]]
z[z > 1] regards, Albert Am Donnerstag, den 24.01.2008, 10:54 -0300 schrieb Juan Pablo Fededa:> Dear Contributors: > > I have the next vector: > > "Z" > > z = (526, 0.1, 110, 0.2, 34, 0.4, 614, 0.5, 1, 14, 15) > > > I want to generate a vector containing the values higher than 1 > corresponding to the z vector, wich in this case will mean to generate the > next vector: > > (526, 110, 34, 614, 14, 15) > > > If you have any clue on how to do that, I will be very glad to hear it!!!!!! > Thanks in advance again, > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.