Gabor Grothendieck wrote:
> On Fri, Mar 13, 2009 at 10:11 AM, Wacek Kusnierczyk
> wrote:
>
>> Gabor Grothendieck wrote:
>>
>>> If all your code has semicolons you could write a program that
>>> puts each statement on one line based on the semicolons and
>>> then passing it through R will r
On Fri, Mar 13, 2009 at 10:11 AM, Wacek Kusnierczyk
wrote:
> Gabor Grothendieck wrote:
>> If all your code has semicolons you could write a program that
>> puts each statement on one line based on the semicolons and
>> then passing it through R will reformat it in a standard way.
>> See Rtidy.bat
On 13-Mar-09 12:55:35, Paul Suckling wrote:
> Dear all.
> After much grief I have finally found the source of some weird
> discrepancies in results generated using R. It turns out that this is
> due to the way R handles multi-line expressions. Here is an example
> with R version 2.8.1:
>
> ---
Gabor Grothendieck wrote:
> If all your code has semicolons you could write a program that
> puts each statement on one line based on the semicolons and
> then passing it through R will reformat it in a standard way.
> See Rtidy.bat in the batchfiles distribution for the reformatting part:
> http:/
If all your code has semicolons you could write a program that
puts each statement on one line based on the semicolons and
then passing it through R will reformat it in a standard way.
See Rtidy.bat in the batchfiles distribution for the reformatting part:
http://batchfiles.googlecode.com
On Fri,
jim holtman wrote:
>
>
>> if (1 == 1) {print (TRUE)
>>
> + } else {print (FALSE)}
> [1] TRUE
>
>
> so the parse knows that the initial 'if' is not complete on the single line.
>
... and likewise the original code could be rewritten as
f <- { a
+ b
+ c }
vQ
__
I get it. Thanks everyone for the feedback.
Now that I understand how it works, my comment would be that this
system is dangerous since it makes it difficult to read the code and
easy to make errors when typing it. I recognise that this is something
so fundamental that it is unlikely to be changed
Paul Suckling wrote:
<...>
>
> # R-script...
>
> r_parse_error <- function ()
> {
>
<...>
> f <- a
> + b
> + c;
> }
>
>
<...>
> f 1
>
>
> As far as I am concerned f should hav
On Fri, 13 Mar 2009, Paul Suckling wrote:
Dear all.
After much grief I have finally found the source of some weird
discrepancies in results generated using R. It turns out that this is
due to the way R handles multi-line expressions. Here is an example
with R version 2.8.1:
---
This is a perfectly legal expression:
f <- a
+ b
+ c;
Type it in a the console, and it will assign a to f and then print out
the values of b and c. In parsing 'f <- a' that is a complete
expression. You may be confused since you think that semicolons
terminate an expression; that is not t
Dear all.
After much grief I have finally found the source of some weird
discrepancies in results generated using R. It turns out that this is
due to the way R handles multi-line expressions. Here is an example
with R version 2.8.1:
# R-script.
11 matches
Mail list logo