Created attachment 2310 [details]
Enquote varNames[varIndex] using backticks
This self-contained example demonstrates the problem:
nls(`NO [µmol/l]` ~ a + k*exp(t),start=list(a=0,k=1),
A possible fix involves putting backticks around varNames[varIndex] in nls.R. But there could be a way which avoids to parse the formula after reconstructing it.
I agree this is a bug. lm() does work w/o problem in such a case.
Yes, we should adhere to our own preaching and not use parse(text=.) I think.
The code in question *does* mention that it is ugly / should be changed.
... I am not really convinced by the patch consequently...
Fixed today, for now in R-devel 73972 -- planned to port to R-patched "next year".