emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* HowTo?  have R :sessions in org mode invoke a specific R
@ 2013-11-04 17:22 Cook, Malcolm
  2013-11-04 18:02 ` John Hendy
  0 siblings, 1 reply; 5+ messages in thread
From: Cook, Malcolm @ 2013-11-04 17:22 UTC (permalink / raw)
  To: 'Org-Mode'

I wish to lock an org buffer to a particular installation of R so that all code blocks use it.

I found that I could not, for instance, write `:session R-3.0.1`.

Is there some best way for me to accomplish this?

Perhaps some way of setting inferior-R-program-name to a buffer local value?

Thanks!

~Malcolm

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

* Re: HowTo? have R :sessions in org mode invoke a specific R
  2013-11-04 17:22 HowTo? have R :sessions in org mode invoke a specific R Cook, Malcolm
@ 2013-11-04 18:02 ` John Hendy
  2013-11-25 21:16   ` Cook, Malcolm
  0 siblings, 1 reply; 5+ messages in thread
From: John Hendy @ 2013-11-04 18:02 UTC (permalink / raw)
  To: Cook, Malcolm; +Cc: Org-Mode

On Mon, Nov 4, 2013 at 11:22 AM, Cook, Malcolm <MEC@stowers.org> wrote:
> I wish to lock an org buffer to a particular installation of R so that all code blocks use it.
>
> I found that I could not, for instance, write `:session R-3.0.1`.
>
> Is there some best way for me to accomplish this?
>
> Perhaps some way of setting inferior-R-program-name to a buffer local value?

I'm no good at in-buffer variables, but this one looks of interest:
org-babel-R-command

Mine on linux is just set to `R --slave --no-save`, but on Windows, I
have to set the full path, so there's no reason you couldn't do the
same (just that I simply use setq() and you'd be doing it in-buffer).


Hope that helps,
John

>
> Thanks!
>
> ~Malcolm
>
>

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

* Re: HowTo? have R :sessions in org mode invoke a specific R
  2013-11-04 18:02 ` John Hendy
@ 2013-11-25 21:16   ` Cook, Malcolm
  2013-11-25 21:56     ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Cook, Malcolm @ 2013-11-25 21:16 UTC (permalink / raw)
  To: 'John Hendy'; +Cc: 'Org-Mode'

>On Mon, Nov 4, 2013 at 11:22 AM, Cook, Malcolm <MEC@stowers.org> wrote:
 >> I wish to lock an org buffer to a particular installation of R so that all code blocks use it.
 >>
 >> I found that I could not, for instance, write `:session R-3.0.1`.
 >>
 >> Is there some best way for me to accomplish this?
 >>
 >> Perhaps some way of setting inferior-R-program-name to a buffer local value?
 >
 >I'm no good at in-buffer variables, but this one looks of interest:
 >org-babel-R-command

Indeed, John,  that is the variable I would like to have respected when I

(setq-local inferior-R-program-name "R-3.0.1")


But, alas it is not.

Any other takers?

Thanks!



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

* Re: HowTo? have R :sessions in org mode invoke a specific R
  2013-11-25 21:16   ` Cook, Malcolm
@ 2013-11-25 21:56     ` Nick Dokos
  2015-10-16 19:44       ` Cook, Malcolm
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2013-11-25 21:56 UTC (permalink / raw)
  To: emacs-orgmode

"Cook, Malcolm" <MEC@stowers.org> writes:

>>On Mon, Nov 4, 2013 at 11:22 AM, Cook, Malcolm <MEC@stowers.org> wrote:
>  >> I wish to lock an org buffer to a particular installation of R so that all code blocks use it.
>  >>
>  >> I found that I could not, for instance, write `:session R-3.0.1`.
>  >>
>  >> Is there some best way for me to accomplish this?
>  >>
>  >> Perhaps some way of setting inferior-R-program-name to a buffer local value?
>  >
>  >I'm no good at in-buffer variables, but this one looks of interest:
>  >org-babel-R-command
>
> Indeed, John,  that is the variable I would like to have respected when I
>
> (setq-local inferior-R-program-name "R-3.0.1")
>
>
> But, alas it is not.
>
> Any other takers?
>
> Thanks!

I think you got it backwards: if you are trying to use org-babel to
evaluate an R code block, then the variable you should set is
org-babel-R-command as John indicated. Setting inferior-R-program-name
to something does not tell anything to org-babel. To use your term,
org-babel does not respect inferior-R-program-name; the only thing it
knows is org-babel-R-command. Only ESS respects inferior-R-program-name,
but you are not using ESS here. So have you tried

 (setq-local org-babel-R-command "R-3.0.1 --slave --no-save")

in your org-mode buffer where you are evaluating your R code?
The options are guesses based on the current setting. Untested since
I know virtually nothing about R.

Nick

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

* Re: HowTo? have R :sessions in org mode invoke a specific R
  2013-11-25 21:56     ` Nick Dokos
@ 2015-10-16 19:44       ` Cook, Malcolm
  0 siblings, 0 replies; 5+ messages in thread
From: Cook, Malcolm @ 2015-10-16 19:44 UTC (permalink / raw)
  To: 'Nick Dokos', emacs-orgmode@gnu.org

Replying on an old thread:

> >>On Mon, Nov 4, 2013 at 11:22 AM, Cook, Malcolm <MEC@stowers.org>
 > wrote:
 > >  >> I wish to lock an org buffer to a particular installation of R so that all
 > code blocks use it.
 > >  >>
 > >  >> I found that I could not, for instance, write `:session R-3.0.1`.
 > >  >>
 > >  >> Is there some best way for me to accomplish this?
 > >  >>
 > >  >> Perhaps some way of setting inferior-R-program-name to a buffer local
 > value?
 > >  >
 > >  >I'm no good at in-buffer variables, but this one looks of interest:
 > >  >org-babel-R-command
 > >
 > > Indeed, John,  that is the variable I would like to have respected
 > > when I
 > >
 > > (setq-local inferior-R-program-name "R-3.0.1")
 > >
 > >
 > > But, alas it is not.
 > >
 > > Any other takers?
 > >
 > > Thanks!
 > 
 > I think you got it backwards: if you are trying to use org-babel to evaluate an R
 > code block, then the variable you should set is org-babel-R-command as John
 > indicated. Setting inferior-R-program-name to something does not tell
 > anything to org-babel. To use your term, org-babel does not respect inferior-
 > R-program-name; the only thing it knows is org-babel-R-command. Only ESS
 > respects inferior-R-program-name, but you are not using ESS here. So have
 > you tried
 > 
 >  (setq-local org-babel-R-command "R-3.0.1 --slave --no-save")

Yes!  Indeed!  And, Thanks!  

And... I don't even need to remember to eval the setq statement if I include in my org the following works everytime

# Local Variables:
# org-babel-R-command: "R-3.0.1 --slave --no-save"
# End:

Or put it as first line in the file:

# -*- org-babel-R-command: "R-3.0.1 --slave --no-save"-*-

Cheers,

Malcolm

 > 
 > in your org-mode buffer where you are evaluating your R code?
 > The options are guesses based on the current setting. Untested since I know
 > virtually nothing about R.
 > 
 > Nick
 > 

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

end of thread, other threads:[~2015-10-16 19:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-04 17:22 HowTo? have R :sessions in org mode invoke a specific R Cook, Malcolm
2013-11-04 18:02 ` John Hendy
2013-11-25 21:16   ` Cook, Malcolm
2013-11-25 21:56     ` Nick Dokos
2015-10-16 19:44       ` Cook, Malcolm

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