Re: [R] Problem with parser and if/else

About this list Date view Thread view Subject view Author view Attachment view

From: Prof Brian Ripley (ripley@stats.ox.ac.uk)
Date: Fri 14 Nov 2003 - 03:38:12 EST


Message-id: <Pine.LNX.4.44.0311131634350.1761-100000@gannet.stats>

On Thu, 13 Nov 2003, Ben Bolker wrote:

> With all due respect to BDR and you, I think this behavior is not
> obvious to casual/new users (using the R search page with "if else" as the
> search string turns up nearly identical queries from 1998, 2001, and
> 2002). There's a philosophical issue here, of course, about how much we
> need to hold people's hands/fill the help files with details about
> behavior that is clearly defined but not obvious to beginners. (And the
> fact that some people don't read help pages anyway ...)
>
> I don't have the new edition of MASS (shame on me), but looking at both
> p. 93 of MASS 3d ed. and at help("if") in R 1.8.0, I don't see this
> problem clearly highlighted (yes, reading the syntax

Well, do take a look at MASS4 p.58 as it is completely different from that
citation.

  A little care is needed when entering \sfn{if ... else} statements to
  ensure that the input is not syntactically complete before the \sfn{else}
  clause, and braces can help with achieving this.

That is exactly the point.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Thu 01 Jan 2004 - 09:20:41 EST