[R] return inconsistency?
Ralf Goertz
r_goertz @end|ng |rom web@de
Wed Apr 30 11:15:02 CEST 2025
I made a stupid error when programming a function. I used
> return(OR^2+6*OR+1)/(OR*se^2)
Being parenthesis blind it took me half an hour to find the reason for
the nonsensical results I got. I should have written
> return((OR^2+6*OR+1)/(OR*se^2))
Having said that why is the first variant (which returns the value of
the numerator only) not a syntax error? I would have expected R to
report something like
> Error: unexpected '/' in "return(OR^2+6*OR+1)/"
If this is not an error what is its purpose?
More information about the R-help
mailing list