Re: [R] R annoyances

From: Robin Hankin <r.hankin_at_noc.soton.ac.uk>
Date: Sat 21 May 2005 - 00:21:24 EST

On May 20, 2005, at 01:14 pm, Liaw, Andy wrote:

[snip]

>> R uses round brackets in two unrelated ways:
>>
>> 4*(1+2) --- using "(" and ")" to signify grouping
>> f(8) function f() evaluated at 8.
>>
>> where there is no reason to use the same parenthesis symbol for both
>> tasks.
>
> The same is done in Fortran/C/C++/Java/Python and God knows how many
> others...
>

well yes, but that doesn't mean it's the Right Thing To Do (tm).

Gabor points out that "f(10)" having meaning whether f is a vector or a function
is interesting. I guess this is right, but I can't think of a real-life situation in which
this would be useful.

>> IMO, the only system with consistent parenthesis use is Mathematica;
>>
>> f[10] # function f[] evaluated at 10
>> 8*(2+2) # parenthesis to override order of operations
>> f[[3]] # third element of list f
>>
>> {} are used for sets.
>
> Just out of curiosity, what's used for grouping expressions?
>

all statements on a line are executed sequentially. Execution continues to next line
if there are any unmatched parentheses or dangling operators.

  So it's a bit pythonesque.

> Andy
>
>

--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Sat May 21 00:24:41 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:57 EST