Hi, I have imported three text files into R using read.table. Their variables are called d, e and f.
I want to run a function on all the possible combinations of these three files. The only way I know how to do that is like this: bigfunction(d,e) bigfunction(d,f) bigfunction(e,d) bigfunction(e,f) bigfunction(f,e) bigfunction(f,d) Is there an easier way? I will have five files later on, so it would be useful to know! I'd imagine I can use a loop somehow, and I have installed a package (gregmisc) so that typing permutations(3,2) gives all the possible pairs of three numbers, but I don't know how to combine these things to make it work. -- View this message in context: http://r.789695.n4.nabble.com/calling-pairs-of-variables-into-a-function-tp3309993p3309993.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.