[R] function as variable name - probably better error message

2015-04-16 Thread Rainer M Krug
Hi The following code works as expected: list(plot=Not any more!) , | plot - Not any more!) | [1] Not any more! ` But for this I get an error: , | function - Not any more! | Error: unexpected assignment in function - ` The error message is quite cryptic and does not help

Re: [R] function as variable name - probably better error message

2015-04-16 Thread Duncan Murdoch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 16/04/2015 6:19 AM, Rainer M Krug wrote: Hi The following code works as expected: list(plot=Not any more!) , | plot - Not any more!) | [1] Not any more! ` But for this I get an error: , | function - Not any more! |

Re: [R] function as variable name - probably better error message

2015-04-16 Thread peter dalgaard
Actually, to split a few hairs, I think the documentation is essentially correct. Reserved words are not the same as quoted strings. You cannot use them in syntactically the same way that you usually use variable names, as unquoted strings in expressions. They can BE variable names, or more