emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Evaluation of R code block depends on case of keywords???
@ 2011-08-19 22:59 Michael Hannon
  2011-08-19 23:36 ` Thomas S. Dye
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Hannon @ 2011-08-19 22:59 UTC (permalink / raw)
  To: Org-Mode List

[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]

Greetings.  I happened to notice that in evaluating R source-code blocks in an
Org-Mode file I got some cruft from my .Rprofile in the output on some
occasions but not on others.

To my surprise, it appears that the CASE of the keywords on the BEGIN_SRC line
affects the output.  Please see the appended for a simple example.

I haven't been able to find this behavior documented any place, but of course
it's possible I just missed it.

Can somebody confirm/deny that Org-Mode is SUPPOSED to behave this way?

Thanks,

-- Mike


* Mike's test of UPPER CASE keywords

#+BEGIN_SRC R :RESULTS output :EXPORTS both

    x <- rnorm(5)

#+END_SRC

#+results:
|   -1.78820283900565 |
|  -0.469227269149123 |
|   -0.92353467915834 |
| -0.0831621941877021 |
|    -1.5583681234565 |



* Mike's test of lower case keywords

#+BEGIN_SRC R :results output :exports both

    x <- rnorm(5)

#+END_SRC

#+results:
: 
: 
: All ready to go...
: 
: Fri Aug 19 15:46:15 2011 
: Hasta la vista!

[-- Attachment #2: Type: text/html, Size: 1365 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Evaluation of R code block depends on case of keywords???
  2011-08-19 22:59 Evaluation of R code block depends on case of keywords??? Michael Hannon
@ 2011-08-19 23:36 ` Thomas S. Dye
  2011-08-20  6:32   ` Michael Hannon
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas S. Dye @ 2011-08-19 23:36 UTC (permalink / raw)
  To: Michael Hannon; +Cc: Org-Mode List

Michael Hannon <jm_hannon@yahoo.com> writes:

> Greetings.  I happened to notice that in evaluating R source-code blocks in an
> Org-Mode file I got some cruft from my .Rprofile in the output on some
> occasions but not on others.
>
> To my surprise, it appears that the CASE of the keywords on the BEGIN_SRC line
> affects the output.  Please see the appended for a simple example.
>
> I haven't been able to find this behavior documented any place, but of course
> it's possible I just missed it.
>
> Can somebody confirm/deny that Org-Mode is SUPPOSED to behave this way?
>
> Thanks,
>
> -- Mike
>
>
> * Mike's test of UPPER CASE keywords
>
> #+BEGIN_SRC R :RESULTS output :EXPORTS both
>
>     x <- rnorm(5)
>
> #+END_SRC
>
> #+results:
> |   -1.78820283900565 |
> |  -0.469227269149123 |
> |   -0.92353467915834 |
> | -0.0831621941877021 |
> |    -1.5583681234565 |
>
>
>
> * Mike's test of lower case keywords
>
> #+BEGIN_SRC R :results output :exports both
>
>     x <- rnorm(5)
>
> #+END_SRC
>
> #+results:
> : 
> : 
> : All ready to go...
> : 
> : Fri Aug 19 15:46:15 2011 
> : Hasta la vista!

Hi Mike,

I believe what is happening is that :RESULTS and :EXPORTS are not
recognized, so :results (the correct header argument) defaults to value.

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Evaluation of R code block depends on case of keywords???
  2011-08-19 23:36 ` Thomas S. Dye
@ 2011-08-20  6:32   ` Michael Hannon
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Hannon @ 2011-08-20  6:32 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org-Mode List

[-- Attachment #1: Type: text/plain, Size: 1891 bytes --]


>> Greetings.  I happened to notice that in evaluating R source-code blocks in
>> an Org-Mode file I got some cruft from my .Rprofile in the output on some
>> occasions but not on others.
>>
>> To my surprise, it appears that the CASE of the keywords on the BEGIN_SRC
>> line affects the output.  Please see the appended for a simple example.
>>
>> I haven't been able to find this behavior documented any place, but of
>> course it's possible I just missed it.
>>
>> Can somebody confirm/deny that Org-Mode is SUPPOSED to behave this way?
>>
>> Thanks,
>>
>> -- Mike
>>
>>
>> * Mike's test of UPPER CASE keywords
>>
>> #+BEGIN_SRC R :RESULTS output :EXPORTS both
>>
>>     x <- rnorm(5)
>>
>> #+END_SRC
>>
>> #+results:
>> |   -1.78820283900565 |
>> |  -0.469227269149123 |
>> |   -0.92353467915834 |
>> | -0.0831621941877021 |
>> |    -1.5583681234565 |
>>
>>
>>
>> * Mike's test of lower case keywords
>>
>> #+BEGIN_SRC R :results output :exports both
>>
>>     x <- rnorm(5)
>>
>> #+END_SRC
>>
>> #+results:
>> :
>> :
>> : All ready to go...
>> :
>> : Fri Aug 19 15:46:15 2011
>> : Hasta la vista!
>
> Hi Mike,

> I believe what is happening is that :RESULTS and :EXPORTS are not
> recognized, so :results (the correct header argument) defaults to value.
> 
> hth,
> Tom
> 
> -- 
> Thomas S. Dye
> http://www.tsdye.com

Thanks, Tom.  I think your explanation is correct.  The manual page:

    http://orgmode.org/manual/Specific-header-arguments.html#Specific-header-arguments

does indeed show all of the arguments in lower case.  I had seen BEGIN_SRC and
begin_src used interchangeably and so assumed that same latitude applied to
the keywords.  And I have a slight preference for putting keywords in upper
case and values in lower case, just to distinguish one class of things from
the other.  My bad.

-- Mike

[-- Attachment #2: Type: text/html, Size: 2674 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-20  6:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-19 22:59 Evaluation of R code block depends on case of keywords??? Michael Hannon
2011-08-19 23:36 ` Thomas S. Dye
2011-08-20  6:32   ` Michael Hannon

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).