Re: [R] [EXTERNAL] RE: unexpected 'else' in " else"

2022-10-28 Thread Jorgen Harmse via R-help
Thank you for the comment. I don�t like the vertical sprawl either, but I assumed for the examples that the variable names were supposed to be very long or were stand-ins for complicated sub-expressions. Sometimes it�s better to put sub-expression results into temporary variables (and possibly u

Re: [R] [EXTERNAL] Re: unexpected 'else' in " else" (Ebert, Timothy Aaron)

2022-10-25 Thread Jorgen Harmse via R-help
Good catch! I also misread it, and I think most people would. If I wanted to write confusing documentation then I could play similar games with 'mode' and 'length'. Regards, Jorgen Harmse. > test <- c(TRUE,FALSE,FALSE) > attr(test,'class') <- 'foo' # probably a bad idea, but I want to see wh

Re: [R] [EXTERNAL] Re: unexpected 'else' in " else" (Ebert, Timothy Aaron)

2022-10-24 Thread Jorgen Harmse via R-help
I agree that the documentation should be clarified. Moreover, my last example shows that the class can be different even when no mode coercion is required. I don't know enough about S3 & S4 to comment on your last point. Regards, Jorgen Harmse. From: Bert Gunter Date: Monday, 24October, 2022

Re: [R] [EXTERNAL] Re: unexpected 'else' in " else"

2022-10-21 Thread Jorgen Harmse via R-help
Thank you. I knew it had nothing to do with the choice of environment, but I thought I had seen such unwrapped code working in files in a previous version. Maybe I misremembered. Incidentally, there is nothing special about braces: anything that makes the statement incomplete will do. Regards,