emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* simple variables as arguments to source block
@ 2013-05-07  9:14 Andreas Leha
  2013-05-07 10:33 ` Rasmus
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Leha @ 2013-05-07  9:14 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

I'd like to pass a string to a source block -- not directly, though, but
through a reference.  What is the recommended way to do this?

This is what I gather from the manual:

--8<---------------cut here---------------start------------->8---
#+name: myvar
| aaa |


#+begin_src R test :var myvar=myvar[0,0]
  print(myvar)
#+end_src
--8<---------------cut here---------------end--------------->8---


My question is: How can I get rid of the [0,0]?

Regards,
Andreas

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

* Re: simple variables as arguments to source block
  2013-05-07  9:14 simple variables as arguments to source block Andreas Leha
@ 2013-05-07 10:33 ` Rasmus
  2013-05-07 10:39   ` Andreas Leha
  0 siblings, 1 reply; 3+ messages in thread
From: Rasmus @ 2013-05-07 10:33 UTC (permalink / raw)
  To: emacs-orgmode

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:

> Hi all,
>
> I'd like to pass a string to a source block -- not directly, though, but
> through a reference.  What is the recommended way to do this?
>
> This is what I gather from the manual:
>
> --8<---------------cut here---------------start------------->8---
> #+name: myvar
> | aaa |
>
> #+begin_src R test :var myvar=myvar[0,0]
>   print(myvar)
> #+end_src
> --8<---------------cut here---------------end--------------->8---
> My question is: How can I get rid of the [0,0]?

How about:

#+BEGIN_SRC Org
#+NAME: myvar
: 4

#+BEGIN_SRC R :var x=myvar
x
#+END_SRC

#+RESULTS:
: 4
#+END_SRC 

-- 
This is the kind of tedious nonsense up with which I will not put

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

* Re: simple variables as arguments to source block
  2013-05-07 10:33 ` Rasmus
@ 2013-05-07 10:39   ` Andreas Leha
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Leha @ 2013-05-07 10:39 UTC (permalink / raw)
  To: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> Hi all,
>>
>> I'd like to pass a string to a source block -- not directly, though, but
>> through a reference.  What is the recommended way to do this?
>>
>> This is what I gather from the manual:
>>
>> --8<---------------cut here---------------start------------->8---
>> #+name: myvar
>> | aaa |
>>
>> #+begin_src R test :var myvar=myvar[0,0]
>>   print(myvar)
>> #+end_src
>> --8<---------------cut here---------------end--------------->8---
>> My question is: How can I get rid of the [0,0]?
>
> How about:
>
> #+BEGIN_SRC Org
> #+NAME: myvar
> : 4
>
> #+BEGIN_SRC R :var x=myvar
> x
> #+END_SRC
>
> #+RESULTS:
> : 4
> #+END_SRC 

Works, indeed.  Thanks.
Andreas

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

end of thread, other threads:[~2013-05-07 10:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07  9:14 simple variables as arguments to source block Andreas Leha
2013-05-07 10:33 ` Rasmus
2013-05-07 10:39   ` Andreas Leha

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).