Re: [R] Solve system of non linear equations using nasted loops

2017-05-11 Thread Berend Hasselman
Your code looks needlessly complicated and inefficient in my view. Even if you don't need or use nested for loops it can still be simplified. 1: First define some new constants to avoid the the M? stuff in your function pME <- ME[2:9]/ME[1] pMI <- MI[2:9]/MI[1] pMA <- MA[2:9]/MA[1] pMAE <-

Re: [R] Solve system of non linear equations using nasted loops

2017-05-10 Thread Bert Gunter
I haven't gone through your code carefully, but I believe this can be done in a tiny fraction of the time you are taking by eschewing loops. See ?expand.grid to get started. In general,nested loops should be avoided if possible. I also suggest you spend some time with a good R tutorial to learn

Re: [R] Solve system of non linear equations using nasted loops

2017-05-10 Thread David Winsemius
> On May 10, 2017, at 11:20 AM, Santiago Burone > wrote: > > Hello, > > I'm new at R and I would like to use it in order to solve a system of non > linear equations. I have the code that works but im not able to save the > results. > > > > My system has three

[R] Solve system of non linear equations using nasted loops

2017-05-10 Thread Santiago Burone
Hello, I'm new at R and I would like to use it in order to solve a system of non linear equations. I have the code that works but im not able to save the results. My system has three equations and i would like to solve this using three nested loops, becouse i need solutions for all the