Skip to content

?if (PR#3179)

3 messages · dominique.couturier@hec.unige.ch, Brian Ripley, Peter Dalgaard

#
hello dear [R] experts,

I use [R] 1.7.0 on Unix and have noticed that I could'nt load the help 
of the function "if" with the command

 >?if
+
+

or the command

 > help(if)
Error: syntax error

I deeply thank you and congratulate you for all your work,
[R] is a wonderfull programm :-)



Regards,
dc
#
What makes you think that is a bug?

?"if" and help("if") work

`An Introduction to R' says

For a feature specified by special characters, the argument must be
enclosed in double or single quotes, making it a ``character string'':

and that is true for a few other examples, as all good books (e.g. 
MASS) point out.
On Tue, 3 Jun 2003 dominique.couturier@hec.unige.ch wrote:

            

  
    
#
Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:
To be precise, we should probably insert "or a reserved word"
in that sentence. 

The point is that parsing occurs prior to the logic that runs help on
the (deparsed) argument, so it's technically no different from "-if"
or "!for" which are also syntactically invalid. The question mark is
just another operator at this stage.