padpadpadpad / nls.multstart

Non-linear regression in R allowing multiple start parameters
18 stars 4 forks source link

fixed for non-standard evaluation #11

Closed mathesong closed 6 years ago

mathesong commented 6 years ago

Non-standard evaluation giving me headaches. This was pretty tough. I'm still not 100% on all the details here, but it works for your model, and it works for my models.

I didn't want to create a weights column of 1, since in an environment, it works like a list, and so it actually has to have the number of items. So I got that from the formula for the dependent variable, and found it in data, and then created a vector of that length. Also, it still didn't seem to work for some reason.

Then I used code I got from the minpack.lm source code to evaluate the input for weights from data to use that. It only means that people can't have a variable name called weights, so I put an error message for that. I thiiiink there's probably a slightly better way to solve this, but I can experiment with it another time, but I feel like I'm going a bit loopy from imagining different environments and how things are understood across them. For now, however, it works.

One issue, though, is that it says it can't automatically merge. I think this is because you made a push while I was working on this. I've tried a few things to pull your version and overwrite mine, but it doesn't seem to be working. Maybe it's easier from your side to merge the changes in? Just say if not and we can try something else. Maybe an option is your reversing your latest push.

padpadpadpad commented 6 years ago

Definitely have not done that optimally. But think it is done. Going to close this PR now.

mathesong commented 6 years ago

Haha! The only reasonable solution with hard git stuff is to burn it to the ground ;).

On 15 Feb 2018 12:03, "Daniel Padfield" notifications@github.com wrote:

Definitely have not done that optimally. But think it is done. Going to close this PR now.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/padpadpadpad/nls.multstart/pull/11#issuecomment-365894585, or mute the thread https://github.com/notifications/unsubscribe-auth/AG25ZMlxUuPxpneflXq8L_JDOvdiwiuTks5tVA8FgaJpZM4SGoyO .