emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* R and babel on Windows problem
@ 2012-06-28 17:46 John Hendy
  2012-06-29 14:59 ` Alexander Vorobiev
  2012-06-29 18:26 ` Achim Gratz
  0 siblings, 2 replies; 27+ messages in thread
From: John Hendy @ 2012-06-28 17:46 UTC (permalink / raw)
  To: emacs-orgmode

I typically use orgmode + babel on Linux and have no problems. Trying
to run on Windows 7 and having issues...

The pertinent bits from .emacs:
----------
;; setup babel
(add-to-list 'load-path "~/.emacs.d/ess-12.04/lisp")
(require 'ess-site)
(setq org-babel-R-command "C:/Program\ Files/R/R-2.15.0/bin/R")
(org-babel-do-load-languages
 'org-babel-load-languages
 '((latex . t)
   (R . t)))
----------

When I try to execute a simple R src block, I get: "The system cannot
find the path specified." I get the same with or without setting the
org-babel-R-command path and with or without using R.exe instead of
just R.

There's an *ESS* buffer that /appears/ to be finding the versions of R
on my machine:
----------
[ess-site.el]: ess-customize-alist=nil
[ess-site.el _2_]: ess-customize-alist=nil
(R): ess-r-versions-create making M-x defuns for
 R-2.15.0-64bit
 R-2.14.1-64bit
----------

Any suggestions?


Best regards,
John

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

* Re: R and babel on Windows problem
  2012-06-28 17:46 R and babel on Windows problem John Hendy
@ 2012-06-29 14:59 ` Alexander Vorobiev
  2012-06-29 15:24   ` John Hendy
  2012-06-29 18:26 ` Achim Gratz
  1 sibling, 1 reply; 27+ messages in thread
From: Alexander Vorobiev @ 2012-06-29 14:59 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

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

John,

Do you have native Windows emacs or cygwin emacs? I use native emacs on XP
with the latest released ess and org-mode, and have no problems with
calling R from babel. I do not set the  org-babel-R-command which has its
default value "R --slave --no-save" and let ess find path to R on my system.

Regards,
Alex

On Thu, Jun 28, 2012 at 12:46 PM, John Hendy <jw.hendy@gmail.com> wrote:

> I typically use orgmode + babel on Linux and have no problems. Trying
> to run on Windows 7 and having issues...
>
> The pertinent bits from .emacs:
> ----------
> ;; setup babel
> (add-to-list 'load-path "~/.emacs.d/ess-12.04/lisp")
> (require 'ess-site)
> (setq org-babel-R-command "C:/Program\ Files/R/R-2.15.0/bin/R")
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((latex . t)
>   (R . t)))
> ----------
>
> When I try to execute a simple R src block, I get: "The system cannot
> find the path specified." I get the same with or without setting the
> org-babel-R-command path and with or without using R.exe instead of
> just R.
>
> There's an *ESS* buffer that /appears/ to be finding the versions of R
> on my machine:
> ----------
> [ess-site.el]: ess-customize-alist=nil
> [ess-site.el _2_]: ess-customize-alist=nil
> (R): ess-r-versions-create making M-x defuns for
>  R-2.15.0-64bit
>  R-2.14.1-64bit
> ----------
>
> Any suggestions?
>
>
> Best regards,
> John
>
>

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

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

* Re: R and babel on Windows problem
  2012-06-29 14:59 ` Alexander Vorobiev
@ 2012-06-29 15:24   ` John Hendy
  2012-06-29 17:12     ` Alexander Vorobiev
  0 siblings, 1 reply; 27+ messages in thread
From: John Hendy @ 2012-06-29 15:24 UTC (permalink / raw)
  To: Alexander Vorobiev; +Cc: emacs-orgmode

On Fri, Jun 29, 2012 at 9:59 AM, Alexander Vorobiev
<alexander.vorobiev@gmail.com> wrote:
> John,
>
> Do you have native Windows emacs or cygwin emacs? I use native emacs on XP
> with the latest released ess and org-mode, and have no problems with calling
> R from babel. I do not set the  org-babel-R-command which has its default
> value "R --slave --no-save" and let ess find path to R on my system.
>

I installed native Windows and compile org-mode from git with that no
compiler worg ditty.
-- http://orgmode.org/worg/org-hacks.html#compiling-org-without-make

Actually, in finding that page, it looks like it's been updated. I've
been using that compile-org lisp code in .emacs and now it appears
that functionality is included by default. Maybe I'll update via git
and use the built in stuff to see if that helps?

Like I said, setting org-babel-R-command makes no difference
(commenting it out and re-loading .emacs still produces the error).

Also, ess, as posted below, *does* seem to find my installed R
versions, so it doesn't seem to be an ess issue?


Any other suggestions to try?
John

> Regards,
> Alex
>
>
> On Thu, Jun 28, 2012 at 12:46 PM, John Hendy <jw.hendy@gmail.com> wrote:
>>
>> I typically use orgmode + babel on Linux and have no problems. Trying
>> to run on Windows 7 and having issues...
>>
>> The pertinent bits from .emacs:
>> ----------
>> ;; setup babel
>> (add-to-list 'load-path "~/.emacs.d/ess-12.04/lisp")
>> (require 'ess-site)
>> (setq org-babel-R-command "C:/Program\ Files/R/R-2.15.0/bin/R")
>> (org-babel-do-load-languages
>>  'org-babel-load-languages
>>  '((latex . t)
>>   (R . t)))
>> ----------
>>
>> When I try to execute a simple R src block, I get: "The system cannot
>> find the path specified." I get the same with or without setting the
>> org-babel-R-command path and with or without using R.exe instead of
>> just R.
>>
>> There's an *ESS* buffer that /appears/ to be finding the versions of R
>> on my machine:
>> ----------
>> [ess-site.el]: ess-customize-alist=nil
>> [ess-site.el _2_]: ess-customize-alist=nil
>> (R): ess-r-versions-create making M-x defuns for
>>  R-2.15.0-64bit
>>  R-2.14.1-64bit
>> ----------
>>
>> Any suggestions?
>>
>>
>> Best regards,
>> John
>>
>

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

* Re: R and babel on Windows problem
  2012-06-29 15:24   ` John Hendy
@ 2012-06-29 17:12     ` Alexander Vorobiev
  0 siblings, 0 replies; 27+ messages in thread
From: Alexander Vorobiev @ 2012-06-29 17:12 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

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

John,

I have no experience with the development version of org-mode. Try
activating 'enter debugger on error' flag to see where exactly it runs into
problems. Also try launching R first in ess so that there is active R
session available to babel.

Regards,
Alex


On Fri, Jun 29, 2012 at 10:24 AM, John Hendy <jw.hendy@gmail.com> wrote:

> On Fri, Jun 29, 2012 at 9:59 AM, Alexander Vorobiev
> <alexander.vorobiev@gmail.com> wrote:
> > John,
> >
> > Do you have native Windows emacs or cygwin emacs? I use native emacs on
> XP
> > with the latest released ess and org-mode, and have no problems with
> calling
> > R from babel. I do not set the  org-babel-R-command which has its default
> > value "R --slave --no-save" and let ess find path to R on my system.
> >
>
> I installed native Windows and compile org-mode from git with that no
> compiler worg ditty.
> -- http://orgmode.org/worg/org-hacks.html#compiling-org-without-make
>
> Actually, in finding that page, it looks like it's been updated. I've
> been using that compile-org lisp code in .emacs and now it appears
> that functionality is included by default. Maybe I'll update via git
> and use the built in stuff to see if that helps?
>
> Like I said, setting org-babel-R-command makes no difference
> (commenting it out and re-loading .emacs still produces the error).
>
> Also, ess, as posted below, *does* seem to find my installed R
> versions, so it doesn't seem to be an ess issue?
>
>
> Any other suggestions to try?
> John
>
> > Regards,
> > Alex
> >
> >
> > On Thu, Jun 28, 2012 at 12:46 PM, John Hendy <jw.hendy@gmail.com> wrote:
> >>
> >> I typically use orgmode + babel on Linux and have no problems. Trying
> >> to run on Windows 7 and having issues...
> >>
> >> The pertinent bits from .emacs:
> >> ----------
> >> ;; setup babel
> >> (add-to-list 'load-path "~/.emacs.d/ess-12.04/lisp")
> >> (require 'ess-site)
> >> (setq org-babel-R-command "C:/Program\ Files/R/R-2.15.0/bin/R")
> >> (org-babel-do-load-languages
> >>  'org-babel-load-languages
> >>  '((latex . t)
> >>   (R . t)))
> >> ----------
> >>
> >> When I try to execute a simple R src block, I get: "The system cannot
> >> find the path specified." I get the same with or without setting the
> >> org-babel-R-command path and with or without using R.exe instead of
> >> just R.
> >>
> >> There's an *ESS* buffer that /appears/ to be finding the versions of R
> >> on my machine:
> >> ----------
> >> [ess-site.el]: ess-customize-alist=nil
> >> [ess-site.el _2_]: ess-customize-alist=nil
> >> (R): ess-r-versions-create making M-x defuns for
> >>  R-2.15.0-64bit
> >>  R-2.14.1-64bit
> >> ----------
> >>
> >> Any suggestions?
> >>
> >>
> >> Best regards,
> >> John
> >>
> >
>

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

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

* Re: R and babel on Windows problem
  2012-06-28 17:46 R and babel on Windows problem John Hendy
  2012-06-29 14:59 ` Alexander Vorobiev
@ 2012-06-29 18:26 ` Achim Gratz
  2012-06-29 19:31   ` John Hendy
  1 sibling, 1 reply; 27+ messages in thread
From: Achim Gratz @ 2012-06-29 18:26 UTC (permalink / raw)
  To: emacs-orgmode

[re-sent]

John Hendy writes:
> I typically use orgmode + babel on Linux and have no problems. Trying
> to run on Windows 7 and having issues...
>
> (setq org-babel-R-command "C:/Program\ Files/R/R-2.15.0/bin/R")

Try the 8.3 compatible name to avoid the space in the path.  If it ever
goes through more than one level of unquoting it will otherwise break.

(setq org-babel-R-command "C:/Progra~1/R/R-2.15.0/bin/R")


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

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

* Re: R and babel on Windows problem
  2012-06-29 18:26 ` Achim Gratz
@ 2012-06-29 19:31   ` John Hendy
  2012-06-29 19:37     ` Nick Dokos
  2012-06-30  5:13     ` Achim Gratz
  0 siblings, 2 replies; 27+ messages in thread
From: John Hendy @ 2012-06-29 19:31 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

On Fri, Jun 29, 2012 at 1:26 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
> [re-sent]
>
> John Hendy writes:
>> I typically use orgmode + babel on Linux and have no problems. Trying
>> to run on Windows 7 and having issues...
>>
>> (setq org-babel-R-command "C:/Program\ Files/R/R-2.15.0/bin/R")
>
> Try the 8.3 compatible name to avoid the space in the path.  If it ever
> goes through more than one level of unquoting it will otherwise break.
>
> (setq org-babel-R-command "C:/Progra~1/R/R-2.15.0/bin/R")

Same error. Also, curiously, =M-x customize-variable RET org-babel-R
TAB= yields no results... is this the right variable?


John

>
>
> Regards,
> Achim.
> --
> +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
>
> Factory and User Sound Singles for Waldorf Blofeld:
> http://Synth.Stromeko.net/Downloads.html#WaldorfSounds
>
>

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

* Re: R and babel on Windows problem
  2012-06-29 19:31   ` John Hendy
@ 2012-06-29 19:37     ` Nick Dokos
  2012-06-29 20:00       ` John Hendy
  2012-06-30  5:13     ` Achim Gratz
  1 sibling, 1 reply; 27+ messages in thread
From: Nick Dokos @ 2012-06-29 19:37 UTC (permalink / raw)
  To: John Hendy; +Cc: Achim Gratz, emacs-orgmode

John Hendy <jw.hendy@gmail.com> wrote:

> On Fri, Jun 29, 2012 at 1:26 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
> > [re-sent]
> >
> > John Hendy writes:
> >> I typically use orgmode + babel on Linux and have no problems. Trying
> >> to run on Windows 7 and having issues...
> >>
> >> (setq org-babel-R-command "C:/Program\ Files/R/R-2.15.0/bin/R")
> >
> > Try the 8.3 compatible name to avoid the space in the path.  If it ever
> > goes through more than one level of unquoting it will otherwise break.
> >
> > (setq org-babel-R-command "C:/Progra~1/R/R-2.15.0/bin/R")
> 
> Same error. Also, curiously, =M-x customize-variable RET org-babel-R
> TAB= yields no results... is this the right variable?
> 

It is, but it seems not to have a customizable interface I guess: I get
the same result you do with customize-variable. OTOH, C-h v
org-babel-R-TAB brings it up with no problem.

Nick

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

* Re: R and babel on Windows problem
  2012-06-29 19:37     ` Nick Dokos
@ 2012-06-29 20:00       ` John Hendy
  2012-06-29 20:16         ` Nick Dokos
  0 siblings, 1 reply; 27+ messages in thread
From: John Hendy @ 2012-06-29 20:00 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Achim Gratz, emacs-orgmode

On Fri, Jun 29, 2012 at 2:37 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> On Fri, Jun 29, 2012 at 1:26 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
>> > [re-sent]
>> >
>> > John Hendy writes:
>> >> I typically use orgmode + babel on Linux and have no problems. Trying
>> >> to run on Windows 7 and having issues...
>> >>
>> >> (setq org-babel-R-command "C:/Program\ Files/R/R-2.15.0/bin/R")
>> >
>> > Try the 8.3 compatible name to avoid the space in the path.  If it ever
>> > goes through more than one level of unquoting it will otherwise break.
>> >
>> > (setq org-babel-R-command "C:/Progra~1/R/R-2.15.0/bin/R")
>>
>> Same error. Also, curiously, =M-x customize-variable RET org-babel-R
>> TAB= yields no results... is this the right variable?
>>


> It is, but it seems not to have a customizable interface I guess: I get
> the same result you do with customize-variable. OTOH, C-h v
> org-babel-R-TAB brings it up with no problem.

Good call. It comes up with that and is set to the above (Progra~1
version) but is still saying command not found when I try C-c C-c on a
babel block.

Any debug methods?

Using =M-x R= works find. ESS is finding R. I successfully loaded a
.csv, ggplot2 and plotted.


John

John

>
> Nick
>

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

* Re: R and babel on Windows problem
  2012-06-29 20:00       ` John Hendy
@ 2012-06-29 20:16         ` Nick Dokos
  2012-07-02 20:15           ` John Hendy
  0 siblings, 1 reply; 27+ messages in thread
From: Nick Dokos @ 2012-06-29 20:16 UTC (permalink / raw)
  To: John Hendy; +Cc: Achim Gratz, emacs-orgmode

John Hendy <jw.hendy@gmail.com> wrote:

> On Fri, Jun 29, 2012 at 2:37 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> > John Hendy <jw.hendy@gmail.com> wrote:
> >
> >> On Fri, Jun 29, 2012 at 1:26 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
> >> > [re-sent]
> >> >
> >> > John Hendy writes:
> >> >> I typically use orgmode + babel on Linux and have no problems. Trying
> >> >> to run on Windows 7 and having issues...
> >> >>
> >> >> (setq org-babel-R-command "C:/Program\ Files/R/R-2.15.0/bin/R")
> >> >
> >> > Try the 8.3 compatible name to avoid the space in the path.  If it ever
> >> > goes through more than one level of unquoting it will otherwise break.
> >> >
> >> > (setq org-babel-R-command "C:/Progra~1/R/R-2.15.0/bin/R")
> >>
> >> Same error. Also, curiously, =M-x customize-variable RET org-babel-R
> >> TAB= yields no results... is this the right variable?
> >>
> 
> 
> > It is, but it seems not to have a customizable interface I guess: I get
> > the same result you do with customize-variable. OTOH, C-h v
> > org-babel-R-TAB brings it up with no problem.
> 
> Good call. It comes up with that and is set to the above (Progra~1
> version) but is still saying command not found when I try C-c C-c on a
> babel block.
> 
> Any debug methods?
> 

edebug org-babel-R-evaluate-external-process and single step through it
perhaps? I would clean up .elc files and start a new emacs before trying
that just to makee sure that I have a clean slate. You might have to go
down to org-babel-eval as well and single step through that.

Nick

> Using =M-x R= works find. ESS is finding R. I successfully loaded a
> .csv, ggplot2 and plotted.
> 
> 
> John
> 
> John
> 
> >
> > Nick
> >
> 

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

* Re: R and babel on Windows problem
  2012-06-29 19:31   ` John Hendy
  2012-06-29 19:37     ` Nick Dokos
@ 2012-06-30  5:13     ` Achim Gratz
  2012-06-30 13:15       ` Eric Schulte
  1 sibling, 1 reply; 27+ messages in thread
From: Achim Gratz @ 2012-06-30  5:13 UTC (permalink / raw)
  To: emacs-orgmode

John Hendy writes:
>> (setq org-babel-R-command "C:/Progra~1/R/R-2.15.0/bin/R")
>
> Same error. Also, curiously, =M-x customize-variable RET org-babel-R
> TAB= yields no results... is this the right variable?

That variable doesn't seem to have acustomize interface.  Might be worth
a bug report.

If the error persists, then it doesn't seem to be the R command that is
not found.  I don't know what is involved in setting up an R session,
much less on Windows.  You might have more luck to just install Cygwin
and use Emacs/R from there if you already know your way around Linux.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables

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

* Re: R and babel on Windows problem
  2012-06-30  5:13     ` Achim Gratz
@ 2012-06-30 13:15       ` Eric Schulte
  0 siblings, 0 replies; 27+ messages in thread
From: Eric Schulte @ 2012-06-30 13:15 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

> John Hendy writes:
>>> (setq org-babel-R-command "C:/Progra~1/R/R-2.15.0/bin/R")
>>
>> Same error. Also, curiously, =M-x customize-variable RET org-babel-R
>> TAB= yields no results... is this the right variable?
>
> That variable doesn't seem to have acustomize interface.  Might be worth
> a bug report.
>

I just pushed up a change which defines the `org-babel-R-command'
variable using a defcustom, so it should now be customizable.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

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

* Re: R and babel on Windows problem
  2012-06-29 20:16         ` Nick Dokos
@ 2012-07-02 20:15           ` John Hendy
  2012-07-02 21:26             ` Nick Dokos
  0 siblings, 1 reply; 27+ messages in thread
From: John Hendy @ 2012-07-02 20:15 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Achim Gratz, emacs-orgmode

On Fri, Jun 29, 2012 at 3:16 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> On Fri, Jun 29, 2012 at 2:37 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>> > John Hendy <jw.hendy@gmail.com> wrote:
>> >
>> >> On Fri, Jun 29, 2012 at 1:26 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
>> >> > [re-sent]
>> >> >
>> >> > John Hendy writes:
>> >> >> I typically use orgmode + babel on Linux and have no problems. Trying
>> >> >> to run on Windows 7 and having issues...
>> >> >>
>> >> >> (setq org-babel-R-command "C:/Program\ Files/R/R-2.15.0/bin/R")
>> >> >
>> >> > Try the 8.3 compatible name to avoid the space in the path.  If it ever
>> >> > goes through more than one level of unquoting it will otherwise break.
>> >> >
>> >> > (setq org-babel-R-command "C:/Progra~1/R/R-2.15.0/bin/R")
>> >>
>> >> Same error. Also, curiously, =M-x customize-variable RET org-babel-R
>> >> TAB= yields no results... is this the right variable?
>> >>
>>
>>
>> > It is, but it seems not to have a customizable interface I guess: I get
>> > the same result you do with customize-variable. OTOH, C-h v
>> > org-babel-R-TAB brings it up with no problem.
>>
>> Good call. It comes up with that and is set to the above (Progra~1
>> version) but is still saying command not found when I try C-c C-c on a
>> babel block.
>>
>> Any debug methods?
>>
>
> edebug org-babel-R-evaluate-external-process and single step through it
> perhaps? I would clean up .elc files and start a new emacs before trying
> that just to makee sure that I have a clean slate. You might have to go
> down to org-babel-eval as well and single step through that.

Just did a fresh git clone and make via the updated non-gnu-tools
method on worg.

The above = `M-x edebug org-babel-R-evaluate-external-process`?

I've never done this. When I do `M-x edebug TAB` I get various edebug
completions but not it as a standalone command.


John


>
> Nick
>
>> Using =M-x R= works find. ESS is finding R. I successfully loaded a
>> .csv, ggplot2 and plotted.
>>
>>
>> John
>>
>> John
>>
>> >
>> > Nick
>> >
>>

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

* Re: R and babel on Windows problem
  2012-07-02 20:15           ` John Hendy
@ 2012-07-02 21:26             ` Nick Dokos
  2012-07-02 21:47               ` John Hendy
  0 siblings, 1 reply; 27+ messages in thread
From: Nick Dokos @ 2012-07-02 21:26 UTC (permalink / raw)
  To: John Hendy; +Cc: Achim Gratz, emacs-orgmode

John Hendy <jw.hendy@gmail.com> wrote:

> On Fri, Jun 29, 2012 at 3:16 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> > John Hendy <jw.hendy@gmail.com> wrote:
> >
> >> On Fri, Jun 29, 2012 at 2:37 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> >> > John Hendy <jw.hendy@gmail.com> wrote:
> >> >
> >> >> On Fri, Jun 29, 2012 at 1:26 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
> >> >> > [re-sent]
> >> >> >
> >> >> > John Hendy writes:
> >> >> >> I typically use orgmode + babel on Linux and have no problems. Trying
> >> >> >> to run on Windows 7 and having issues...
> >> >> >>
> >> >> >> (setq org-babel-R-command "C:/Program\ Files/R/R-2.15.0/bin/R")
> >> >> >
> >> >> > Try the 8.3 compatible name to avoid the space in the path.  If it ever
> >> >> > goes through more than one level of unquoting it will otherwise break.
> >> >> >
> >> >> > (setq org-babel-R-command "C:/Progra~1/R/R-2.15.0/bin/R")
> >> >>
> >> >> Same error. Also, curiously, =M-x customize-variable RET org-babel-R
> >> >> TAB= yields no results... is this the right variable?
> >> >>
> >>
> >>
> >> > It is, but it seems not to have a customizable interface I guess: I get
> >> > the same result you do with customize-variable. OTOH, C-h v
> >> > org-babel-R-TAB brings it up with no problem.
> >>
> >> Good call. It comes up with that and is set to the above (Progra~1
> >> version) but is still saying command not found when I try C-c C-c on a
> >> babel block.
> >>
> >> Any debug methods?
> >>
> >
> > edebug org-babel-R-evaluate-external-process and single step through it
> > perhaps? I would clean up .elc files and start a new emacs before trying
> > that just to makee sure that I have a clean slate. You might have to go
> > down to org-babel-eval as well and single step through that.
> 
> Just did a fresh git clone and make via the updated non-gnu-tools
> method on worg.
> 
> The above = `M-x edebug org-babel-R-evaluate-external-process`?
> 
> I've never done this. When I do `M-x edebug TAB` I get various edebug
> completions but not it as a standalone command.
> 

Oh, sorry: edebug is described in

(info "(elisp) Edebug")

The basics: visit ob-R.el, go to the org-babel-R-evaluate-external-process
definition and press C-u C-M-x. Then do whatever you were doing to get the
problem. It should stop at the function and you can single-step by pressing
SPACE. At strategic points, you can evaluate things with "e".

If you mess it up (and you probably will a few times), no problem: just try
again. And be patient!

Good luck,
Nick



> 
> John
> 
> 
> >
> > Nick
> >
> >> Using =M-x R= works find. ESS is finding R. I successfully loaded a
> >> .csv, ggplot2 and plotted.
> >>
> >>
> >> John
> >>
> >> John
> >>
> >> >
> >> > Nick
> >> >
> >>
> 

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

* Re: R and babel on Windows problem
  2012-07-02 21:26             ` Nick Dokos
@ 2012-07-02 21:47               ` John Hendy
  2012-07-02 22:15                 ` Nick Dokos
  2012-07-02 22:16                 ` John Hendy
  0 siblings, 2 replies; 27+ messages in thread
From: John Hendy @ 2012-07-02 21:47 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Achim Gratz, emacs-orgmode

On Mon, Jul 2, 2012 at 4:26 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> On Fri, Jun 29, 2012 at 3:16 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>> > John Hendy <jw.hendy@gmail.com> wrote:
>> >
>> >> On Fri, Jun 29, 2012 at 2:37 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>> >> > John Hendy <jw.hendy@gmail.com> wrote:
>> >> >
>> >> >> On Fri, Jun 29, 2012 at 1:26 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
>> >> >> > [re-sent]
>> >> >> >
>> >> >> > John Hendy writes:
>> >> >> >> I typically use orgmode + babel on Linux and have no problems. Trying
>> >> >> >> to run on Windows 7 and having issues...
>> >> >> >>
>> >> >> >> (setq org-babel-R-command "C:/Program\ Files/R/R-2.15.0/bin/R")
>> >> >> >
>> >> >> > Try the 8.3 compatible name to avoid the space in the path.  If it ever
>> >> >> > goes through more than one level of unquoting it will otherwise break.
>> >> >> >
>> >> >> > (setq org-babel-R-command "C:/Progra~1/R/R-2.15.0/bin/R")
>> >> >>
>> >> >> Same error. Also, curiously, =M-x customize-variable RET org-babel-R
>> >> >> TAB= yields no results... is this the right variable?
>> >> >>
>> >>
>> >>
>> >> > It is, but it seems not to have a customizable interface I guess: I get
>> >> > the same result you do with customize-variable. OTOH, C-h v
>> >> > org-babel-R-TAB brings it up with no problem.
>> >>
>> >> Good call. It comes up with that and is set to the above (Progra~1
>> >> version) but is still saying command not found when I try C-c C-c on a
>> >> babel block.
>> >>
>> >> Any debug methods?
>> >>
>> >
>> > edebug org-babel-R-evaluate-external-process and single step through it
>> > perhaps? I would clean up .elc files and start a new emacs before trying
>> > that just to makee sure that I have a clean slate. You might have to go
>> > down to org-babel-eval as well and single step through that.
>>
>> Just did a fresh git clone and make via the updated non-gnu-tools
>> method on worg.
>>
>> The above = `M-x edebug org-babel-R-evaluate-external-process`?
>>
>> I've never done this. When I do `M-x edebug TAB` I get various edebug
>> completions but not it as a standalone command.
>>
>
> Oh, sorry: edebug is described in
>
> (info "(elisp) Edebug")
>
> The basics: visit ob-R.el, go to the org-babel-R-evaluate-external-process
> definition and press C-u C-M-x. Then do whatever you were doing to get the
> problem. It should stop at the function and you can single-step by pressing
> SPACE. At strategic points, you can evaluate things with "e".

Eeks. Is the fact that I learned emacs only for org-mode showing. I
don't even know how to =(info "(elisp) Edebug")= -- do I put an =M-x=
in front of that? =M-x info= seems to bring me to a help page for
info!

Anyway... I just googled edebug and it says about the same as you did
(except for appending "eval-defun with a prefix argument" onto =C-u
C-M-x=.
- http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Edebug.html

Anyway:
- Visited ob-R.el in emacs
- Found org-babel-R-evaluate-external-process
- Put the cursor on the line =(defun org-babel-R-evaluate-external-process=
- Did =M-x C-M-x= and the minibuffer echoed the name of the function
- Visited my file, test.org and did =C-c C-c= on the R babel block
- Nothing different occurred; I just got "The system cannot find the
path specified"

I tried the above again with regular 'ol org-babel-R-evaluate just in
case and had the same results.

I'm clearly goofing something but have no idea what it is.


John


>
> If you mess it up (and you probably will a few times), no problem: just try
> again. And be patient!
>
> Good luck,
> Nick
>
>
>
>>
>> John
>>
>>
>> >
>> > Nick
>> >
>> >> Using =M-x R= works find. ESS is finding R. I successfully loaded a
>> >> .csv, ggplot2 and plotted.
>> >>
>> >>
>> >> John
>> >>
>> >> John
>> >>
>> >> >
>> >> > Nick
>> >> >
>> >>
>>

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

* Re: R and babel on Windows problem
  2012-07-02 21:47               ` John Hendy
@ 2012-07-02 22:15                 ` Nick Dokos
  2012-07-02 22:16                 ` John Hendy
  1 sibling, 0 replies; 27+ messages in thread
From: Nick Dokos @ 2012-07-02 22:15 UTC (permalink / raw)
  To: John Hendy; +Cc: Achim Gratz, emacs-orgmode


John Hendy <jw.hendy@gmail.com> wrote:
...
> >
> > Oh, sorry: edebug is described in
> >
> > (info "(elisp) Edebug")
> >
> > The basics: visit ob-R.el, go to the org-babel-R-evaluate-external-process
> > definition and press C-u C-M-x. Then do whatever you were doing to get the
> > problem. It should stop at the function and you can single-step by pressing
> > SPACE. At strategic points, you can evaluate things with "e".
> 
> Eeks. Is the fact that I learned emacs only for org-mode showing. I
> don't even know how to =(info "(elisp) Edebug")= -- do I put an =M-x=
> in front of that? =M-x info= seems to bring me to a help page for
> info!
> 

You have to evaluate it somehow. If you are reading your mail in emacs,
just place the cursor after the closing paren and press C-x C-e. If not,
just go to emacs and "C-h i elisp RET i edebug RET" or equivalently,
type ESC ESC : (info "(elisp) Edebug") RET. Underlying assumption: you
have the Emacs Lisp info files installed.

> Anyway... I just googled edebug and it says about the same as you did
> (except for appending "eval-defun with a prefix argument" onto =C-u
> C-M-x=.
> - http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Edebug.html
> 
> Anyway:
> - Visited ob-R.el in emacs
> - Found org-babel-R-evaluate-external-process
> - Put the cursor on the line =(defun org-babel-R-evaluate-external-process=
> - Did =M-x C-M-x= and the minibuffer echoed the name of the function

C-u C-M-x please: and the echo area should say "Edebug:
org-babel-R-evaluate-external-process" afterwards.

Nick

> - Visited my file, test.org and did =C-c C-c= on the R babel block
> - Nothing different occurred; I just got "The system cannot find the
> path specified"
> 
> I tried the above again with regular 'ol org-babel-R-evaluate just in
> case and had the same results.
> 
> I'm clearly goofing something but have no idea what it is.
> 
> 
> John
> 
> 
> >
> > If you mess it up (and you probably will a few times), no problem: just try
> > again. And be patient!
> >
> > Good luck,
> > Nick
> >
> >
> >
> >>
> >> John
> >>
> >>
> >> >
> >> > Nick
> >> >
> >> >> Using =M-x R= works find. ESS is finding R. I successfully loaded a
> >> >> .csv, ggplot2 and plotted.
> >> >>
> >> >>
> >> >> John
> >> >>
> >> >> John
> >> >>
> >> >> >
> >> >> > Nick
> >> >> >
> >> >>
> >>
> 

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

* Re: R and babel on Windows problem
  2012-07-02 21:47               ` John Hendy
  2012-07-02 22:15                 ` Nick Dokos
@ 2012-07-02 22:16                 ` John Hendy
  2012-07-06 16:58                   ` John Hendy
  1 sibling, 1 reply; 27+ messages in thread
From: John Hendy @ 2012-07-02 22:16 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Achim Gratz, emacs-orgmode

>
> Anyway:
> - Visited ob-R.el in emacs
> - Found org-babel-R-evaluate-external-process
> - Put the cursor on the line =(defun org-babel-R-evaluate-external-process=
> - Did =M-x C-M-x= and the minibuffer echoed the name of the function
> - Visited my file, test.org and did =C-c C-c= on the R babel block
> - Nothing different occurred; I just got "The system cannot find the
> path specified"
>
> I tried the above again with regular 'ol org-babel-R-evaluate just in
> case and had the same results.
>
> I'm clearly goofing something but have no idea what it is.
>

Okay. I think I may have triggered =edebug-all-defs= when I was
tinkering around earlier and from the page about "instrumenting"
edebug it seemed like that could tweak some things undesirably. I got
that fixed and turned on edebug for
org-babel-R-evaluate-external-process and am getting nothing. The
modeline in my test file has turned to "Org *Debugging* Fill" but
still produces none of the incremental evaluation pauses I would have
expected.

I tried the same with org-babel-execute-src-block in ob.el since
that's what's called first and am still getting no new activity from
edebug. Just the same message about the path.


John


>
> John
>
>
>>
>> If you mess it up (and you probably will a few times), no problem: just try
>> again. And be patient!
>>
>> Good luck,
>> Nick
>>
>>
>>
>>>
>>> John
>>>
>>>
>>> >
>>> > Nick
>>> >
>>> >> Using =M-x R= works find. ESS is finding R. I successfully loaded a
>>> >> .csv, ggplot2 and plotted.
>>> >>
>>> >>
>>> >> John
>>> >>
>>> >> John
>>> >>
>>> >> >
>>> >> > Nick
>>> >> >
>>> >>
>>>

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

* Re: R and babel on Windows problem
  2012-07-02 22:16                 ` John Hendy
@ 2012-07-06 16:58                   ` John Hendy
  2012-07-06 17:12                     ` Nick Dokos
  0 siblings, 1 reply; 27+ messages in thread
From: John Hendy @ 2012-07-06 16:58 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Achim Gratz, emacs-orgmode

On Mon, Jul 2, 2012 at 5:16 PM, John Hendy <jw.hendy@gmail.com> wrote:
>>
>> Anyway:
>> - Visited ob-R.el in emacs
>> - Found org-babel-R-evaluate-external-process
>> - Put the cursor on the line =(defun org-babel-R-evaluate-external-process=
>> - Did =M-x C-M-x= and the minibuffer echoed the name of the function
>> - Visited my file, test.org and did =C-c C-c= on the R babel block
>> - Nothing different occurred; I just got "The system cannot find the
>> path specified"
>>
>> I tried the above again with regular 'ol org-babel-R-evaluate just in
>> case and had the same results.
>>
>> I'm clearly goofing something but have no idea what it is.
>>
>
> Okay. I think I may have triggered =edebug-all-defs= when I was
> tinkering around earlier and from the page about "instrumenting"
> edebug it seemed like that could tweak some things undesirably. I got
> that fixed and turned on edebug for
> org-babel-R-evaluate-external-process and am getting nothing. The
> modeline in my test file has turned to "Org *Debugging* Fill" but
> still produces none of the incremental evaluation pauses I would have
> expected.
>
> I tried the same with org-babel-execute-src-block in ob.el since
> that's what's called first and am still getting no new activity from
> edebug. Just the same message about the path.

Any updates on this? Could someone provide a minimal example I could
try? Or verify that my steps above are correct. I'm not sure why it's
not triggering the step by step function execution described.


Thanks!
John

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

* Re: R and babel on Windows problem
  2012-07-06 16:58                   ` John Hendy
@ 2012-07-06 17:12                     ` Nick Dokos
  2012-07-06 17:46                       ` John Hendy
  0 siblings, 1 reply; 27+ messages in thread
From: Nick Dokos @ 2012-07-06 17:12 UTC (permalink / raw)
  To: John Hendy; +Cc: Achim Gratz, emacs-orgmode

John Hendy <jw.hendy@gmail.com> wrote:

> Any updates on this? Could someone provide a minimal example I could
> try? Or verify that my steps above are correct. I'm not sure why it's
> not triggering the step by step function execution described.
> 

I had sent out a note about C-u C-M-x and what you should see in the
echo area after that, but I don't think I've seen a reply: did you try
that and did it work as expected?

Either gmane is or I am being stupid right now and cannot find the message
(maybe it never made it, but gmane cannot seem to find the thread at all
right now), so I append a copy of that message.

Nick


John Hendy <jw.hendy@gmail.com> wrote:
...
> >
> > Oh, sorry: edebug is described in
> >
> > (info "(elisp) Edebug")
> >
> > The basics: visit ob-R.el, go to the org-babel-R-evaluate-external-process
> > definition and press C-u C-M-x. Then do whatever you were doing to get the
> > problem. It should stop at the function and you can single-step by pressing
> > SPACE. At strategic points, you can evaluate things with "e".
> 
> Eeks. Is the fact that I learned emacs only for org-mode showing. I
> don't even know how to =(info "(elisp) Edebug")= -- do I put an =M-x=
> in front of that? =M-x info= seems to bring me to a help page for
> info!
> 

You have to evaluate it somehow. If you are reading your mail in emacs,
just place the cursor after the closing paren and press C-x C-e. If not,
just go to emacs and "C-h i elisp RET i edebug RET" or equivalently,
type ESC ESC : (info "(elisp) Edebug") RET. Underlying assumption: you
have the Emacs Lisp info files installed.

> Anyway... I just googled edebug and it says about the same as you did
> (except for appending "eval-defun with a prefix argument" onto =C-u
> C-M-x=.
> - http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Edebug.html
> 
> Anyway:
> - Visited ob-R.el in emacs
> - Found org-babel-R-evaluate-external-process
> - Put the cursor on the line =(defun org-babel-R-evaluate-external-process=
> - Did =M-x C-M-x= and the minibuffer echoed the name of the function

C-u C-M-x please: and the echo area should say "Edebug:
org-babel-R-evaluate-external-process" afterwards.

Nick

> - Visited my file, test.org and did =C-c C-c= on the R babel block
> - Nothing different occurred; I just got "The system cannot find the
> path specified"
> 
> I tried the above again with regular 'ol org-babel-R-evaluate just in
> case and had the same results.
> 
> I'm clearly goofing something but have no idea what it is.
> 
> 
> John
> 
> 
> >
> > If you mess it up (and you probably will a few times), no problem: just try
> > again. And be patient!
> >
> > Good luck,
> > Nick
> >
> >
> >
> >>
> >> John
> >>
> >>
> >> >
> >> > Nick
> >> >
> >> >> Using =M-x R= works find. ESS is finding R. I successfully loaded a
> >> >> .csv, ggplot2 and plotted.
> >> >>
> >> >>
> >> >> John
> >> >>
> >> >> John
> >> >>
> >> >> >
> >> >> > Nick
> >> >> >
> >> >>
> >>
> 

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

* Re: R and babel on Windows problem
  2012-07-06 17:12                     ` Nick Dokos
@ 2012-07-06 17:46                       ` John Hendy
  2012-07-06 18:41                         ` Eric Schulte
  2012-07-06 18:45                         ` Nick Dokos
  0 siblings, 2 replies; 27+ messages in thread
From: John Hendy @ 2012-07-06 17:46 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Achim Gratz, emacs-orgmode

On Fri, Jul 6, 2012 at 12:12 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> Any updates on this? Could someone provide a minimal example I could
>> try? Or verify that my steps above are correct. I'm not sure why it's
>> not triggering the step by step function execution described.
>>
>
> I had sent out a note about C-u C-M-x and what you should see in the
> echo area after that, but I don't think I've seen a reply: did you try
> that and did it work as expected?
>
> Either gmane is or I am being stupid right now and cannot find the message
> (maybe it never made it, but gmane cannot seem to find the thread at all
> right now), so I append a copy of that message.

Yes. I guess I didn't explicitly say, but I mentioned that I had
triggered something goofy by accident in my earlier hunt for edebug.
I'll walkthrough right now:
- Got to ob-R.el in emacs
- C-s to find org-babel-R-evaluate-external-process
- C-u C-M-x
- Minibuffer: "Edebug: org-babel-R-evaluate-external-process"
- Visit file test.org
- C-c C-c on the src block
- Well... of course it works now. Not sure what I was doing wrong before.

I pressed space continually until failure, then again to verify the
failing line. It's this one (line 313):

,---
| (output (org-babel-eval org-babel-R-command body))))
`---

When I run this line:

,---
| (org-babel-eval org-babel-R-command
`---

I get this in the minibuffer:

,---
| Result: "C:/Progra~1/R/R-2.15.0/bin/R"
`---

Should I be able to run this from the Windows cmd prompt successfully?
I think this is my problem. Even using tab completion to ensure the
path is correct, I get the same error message "The system cannot find
the path specified" when I run this from cmd!

I guess I honed in on my problem. I can run R from my Start Menu shortcut fine.

Update: I'm on 64bit and just now realized there's another set of R
cmds in ../R-2.15.0/bin/x64/. This is what I needed.

Now my problem is that using R along doesn't produce any output. With
the above modification, I get:

,---
| Fatal error: you must specify '--save', '--no-save' or '--vanilla'
`---

I'm quite close! If I add --no-save, I get exported results but they
include all of the R preamble text from when it starts. Here's my
block for reference:

#+begin_src R :results output org :exports results

x <- c(1:10)
summary(x)

#+end_src



Thanks,
John


>
> Nick
>
>
> John Hendy <jw.hendy@gmail.com> wrote:
> ...
>> >
>> > Oh, sorry: edebug is described in
>> >
>> > (info "(elisp) Edebug")
>> >
>> > The basics: visit ob-R.el, go to the org-babel-R-evaluate-external-process
>> > definition and press C-u C-M-x. Then do whatever you were doing to get the
>> > problem. It should stop at the function and you can single-step by pressing
>> > SPACE. At strategic points, you can evaluate things with "e".
>>
>> Eeks. Is the fact that I learned emacs only for org-mode showing. I
>> don't even know how to =(info "(elisp) Edebug")= -- do I put an =M-x=
>> in front of that? =M-x info= seems to bring me to a help page for
>> info!
>>
>
> You have to evaluate it somehow. If you are reading your mail in emacs,
> just place the cursor after the closing paren and press C-x C-e. If not,
> just go to emacs and "C-h i elisp RET i edebug RET" or equivalently,
> type ESC ESC : (info "(elisp) Edebug") RET. Underlying assumption: you
> have the Emacs Lisp info files installed.
>
>> Anyway... I just googled edebug and it says about the same as you did
>> (except for appending "eval-defun with a prefix argument" onto =C-u
>> C-M-x=.
>> - http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Edebug.html
>>
>> Anyway:
>> - Visited ob-R.el in emacs
>> - Found org-babel-R-evaluate-external-process
>> - Put the cursor on the line =(defun org-babel-R-evaluate-external-process=
>> - Did =M-x C-M-x= and the minibuffer echoed the name of the function
>
> C-u C-M-x please: and the echo area should say "Edebug:
> org-babel-R-evaluate-external-process" afterwards.
>
> Nick
>
>> - Visited my file, test.org and did =C-c C-c= on the R babel block
>> - Nothing different occurred; I just got "The system cannot find the
>> path specified"
>>
>> I tried the above again with regular 'ol org-babel-R-evaluate just in
>> case and had the same results.
>>
>> I'm clearly goofing something but have no idea what it is.
>>
>>
>> John
>>
>>
>> >
>> > If you mess it up (and you probably will a few times), no problem: just try
>> > again. And be patient!
>> >
>> > Good luck,
>> > Nick
>> >
>> >
>> >
>> >>
>> >> John
>> >>
>> >>
>> >> >
>> >> > Nick
>> >> >
>> >> >> Using =M-x R= works find. ESS is finding R. I successfully loaded a
>> >> >> .csv, ggplot2 and plotted.
>> >> >>
>> >> >>
>> >> >> John
>> >> >>
>> >> >> John
>> >> >>
>> >> >> >
>> >> >> > Nick
>> >> >> >
>> >> >>
>> >>
>>
>
>

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

* Re: R and babel on Windows problem
  2012-07-06 17:46                       ` John Hendy
@ 2012-07-06 18:41                         ` Eric Schulte
  2012-07-06 22:05                           ` John Hendy
  2012-07-06 18:45                         ` Nick Dokos
  1 sibling, 1 reply; 27+ messages in thread
From: Eric Schulte @ 2012-07-06 18:41 UTC (permalink / raw)
  To: John Hendy; +Cc: Achim Gratz, nicholas.dokos, emacs-orgmode

>
> Update: I'm on 64bit and just now realized there's another set of R
> cmds in ../R-2.15.0/bin/x64/. This is what I needed.
>
> Now my problem is that using R along doesn't produce any output. With
> the above modification, I get:
>
> ,---
> | Fatal error: you must specify '--save', '--no-save' or '--vanilla'
> `---
>
> I'm quite close! If I add --no-save, I get exported results but they
> include all of the R preamble text from when it starts. Here's my
> block for reference:
>
> #+begin_src R :results output org :exports results
>
> x <- c(1:10)
> summary(x)
>
> #+end_src
>

The default value for org-babel-R-command is "R --slave --no-save", so
maybe adding the "--slave" option to your command will remove the R
preamble text.

As for your path problems, the "~" looks like a likely culprit.  The
command is passed to an equivalent of the `shell-command-on-region'
function, which then uses a shell to run the command.  Maybe the shell
it uses can't handle the tilde?

Best,

p.s., I'm jumping into this thread part way through and didn't read all
      of the back-log, so I apologize if I'm repeating previous advice.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

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

* Re: R and babel on Windows problem
  2012-07-06 17:46                       ` John Hendy
  2012-07-06 18:41                         ` Eric Schulte
@ 2012-07-06 18:45                         ` Nick Dokos
  2012-07-06 22:08                           ` John Hendy
  1 sibling, 1 reply; 27+ messages in thread
From: Nick Dokos @ 2012-07-06 18:45 UTC (permalink / raw)
  To: John Hendy; +Cc: Achim Gratz, emacs-orgmode

John Hendy <jw.hendy@gmail.com> wrote:

> On Fri, Jul 6, 2012 at 12:12 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> > John Hendy <jw.hendy@gmail.com> wrote:
> >
> >> Any updates on this? Could someone provide a minimal example I could
> >> try? Or verify that my steps above are correct. I'm not sure why it's
> >> not triggering the step by step function execution described.
> >>
> >
> > I had sent out a note about C-u C-M-x and what you should see in the
> > echo area after that, but I don't think I've seen a reply: did you try
> > that and did it work as expected?
> >
> > Either gmane is or I am being stupid right now and cannot find the message
> > (maybe it never made it, but gmane cannot seem to find the thread at all
> > right now), so I append a copy of that message.
> 
> Yes. I guess I didn't explicitly say, but I mentioned that I had
> triggered something goofy by accident in my earlier hunt for edebug.
> I'll walkthrough right now:
> - Got to ob-R.el in emacs
> - C-s to find org-babel-R-evaluate-external-process
> - C-u C-M-x
> - Minibuffer: "Edebug: org-babel-R-evaluate-external-process"
> - Visit file test.org
> - C-c C-c on the src block
> - Well... of course it works now. Not sure what I was doing wrong before.
> 

The reason that I sent out that note was that you mentioned pressing M-x
C-M-x (rather than C-u C-M-x) and getting the name of the function
echoed (without the "Edebug: " part), so I wanted to make sure that you
were DTRT here. Could that be what you were doing wrong? or was that a
typo on your part?

> I pressed space continually until failure, then again to verify the
> failing line. It's this one (line 313):
> 
> ,---
> | (output (org-babel-eval org-babel-R-command body))))
> `---
> 

Just fyi and to clarify some basic lisp: the form

     (org-babel-eval org-babel-R-command body)

says: evaluate the org-babel-eval function with arguments
org-babel-R-command and body (actually, those variables are evaluated
first and then the *values* are passed to the function). The evaluation
returns a result (a string in this case) which is assigned to the local
variable output for further processing (local, because this whole thing
is part of a let-form which is not shown in your snippet).

I.e. a function call in lisp always looks like this:

     (<func> <arg1> <arg2> ....)

> When I run this line:
> 
> ,---
> | (org-babel-eval org-babel-R-command
> `---
> 
> I get this in the minibuffer:
> 
> ,---
> | Result: "C:/Progra~1/R/R-2.15.0/bin/R"
> `---
> 

I presume you just typed "e" when the cursor was after the variable:
that just evaluates the variable. If you press SPACE then the cursor
would advance to after the ``body'' variable (on the closing paren) and
an "e" would evaluate *that* variable.  After another SPACE, the cursor
would be *after* the closing paren and an "e" would evaluate the function
call and you would see the result, i.e. what would be assigned to
``output''.

> Should I be able to run this from the Windows cmd prompt successfully?
> I think this is my problem. Even using tab completion to ensure the
> path is correct, I get the same error message "The system cannot find
> the path specified" when I run this from cmd!
> 
> I guess I honed in on my problem. I can run R from my Start Menu shortcut fine.
> 
> Update: I'm on 64bit and just now realized there's another set of R
> cmds in ../R-2.15.0/bin/x64/. This is what I needed.
> 
> Now my problem is that using R along doesn't produce any output. With
> the above modification, I get:
> 
> ,---
> | Fatal error: you must specify '--save', '--no-save' or '--vanilla'
> `---
> 
> I'm quite close! If I add --no-save, I get exported results but they
> include all of the R preamble text from when it starts. Here's my
> block for reference:
> 
> #+begin_src R :results output org :exports results
> 
> x <- c(1:10)
> summary(x)
> 
> #+end_src
> 

OK, at this point I will "exit, stage left, chased by a bear", since
both Windoze and R are within my areas of almost complete ignorance :-)

Nick

> 
> 
> Thanks,
> John
> 
> 
> >
> > Nick
> >
> >
> > John Hendy <jw.hendy@gmail.com> wrote:
> > ...
> >> >
> >> > Oh, sorry: edebug is described in
> >> >
> >> > (info "(elisp) Edebug")
> >> >
> >> > The basics: visit ob-R.el, go to the org-babel-R-evaluate-external-process
> >> > definition and press C-u C-M-x. Then do whatever you were doing to get the
> >> > problem. It should stop at the function and you can single-step by pressing
> >> > SPACE. At strategic points, you can evaluate things with "e".
> >>
> >> Eeks. Is the fact that I learned emacs only for org-mode showing. I
> >> don't even know how to =(info "(elisp) Edebug")= -- do I put an =M-x=
> >> in front of that? =M-x info= seems to bring me to a help page for
> >> info!
> >>
> >
> > You have to evaluate it somehow. If you are reading your mail in emacs,
> > just place the cursor after the closing paren and press C-x C-e. If not,
> > just go to emacs and "C-h i elisp RET i edebug RET" or equivalently,
> > type ESC ESC : (info "(elisp) Edebug") RET. Underlying assumption: you
> > have the Emacs Lisp info files installed.
> >
> >> Anyway... I just googled edebug and it says about the same as you did
> >> (except for appending "eval-defun with a prefix argument" onto =C-u
> >> C-M-x=.
> >> - http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Edebug.html
> >>
> >> Anyway:
> >> - Visited ob-R.el in emacs
> >> - Found org-babel-R-evaluate-external-process
> >> - Put the cursor on the line =(defun org-babel-R-evaluate-external-process=
> >> - Did =M-x C-M-x= and the minibuffer echoed the name of the function
> >
> > C-u C-M-x please: and the echo area should say "Edebug:
> > org-babel-R-evaluate-external-process" afterwards.
> >
> > Nick
> >
> >> - Visited my file, test.org and did =C-c C-c= on the R babel block
> >> - Nothing different occurred; I just got "The system cannot find the
> >> path specified"
> >>
> >> I tried the above again with regular 'ol org-babel-R-evaluate just in
> >> case and had the same results.
> >>
> >> I'm clearly goofing something but have no idea what it is.
> >>
> >>
> >> John
> >>
> >>
> >> >
> >> > If you mess it up (and you probably will a few times), no problem: just try
> >> > again. And be patient!
> >> >
> >> > Good luck,
> >> > Nick
> >> >
> >> >
> >> >
> >> >>
> >> >> John
> >> >>
> >> >>
> >> >> >
> >> >> > Nick
> >> >> >
> >> >> >> Using =M-x R= works find. ESS is finding R. I successfully loaded a
> >> >> >> .csv, ggplot2 and plotted.
> >> >> >>
> >> >> >>
> >> >> >> John
> >> >> >>
> >> >> >> John
> >> >> >>
> >> >> >> >
> >> >> >> > Nick
> >> >> >> >
> >> >> >>
> >> >>
> >>
> >
> >
> 

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

* Re: R and babel on Windows problem
  2012-07-06 18:41                         ` Eric Schulte
@ 2012-07-06 22:05                           ` John Hendy
  0 siblings, 0 replies; 27+ messages in thread
From: John Hendy @ 2012-07-06 22:05 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Achim Gratz, nicholas.dokos, emacs-orgmode

On Fri, Jul 6, 2012 at 1:41 PM, Eric Schulte <eric.schulte@gmx.com> wrote:
>>
>> Update: I'm on 64bit and just now realized there's another set of R
>> cmds in ../R-2.15.0/bin/x64/. This is what I needed.
>>
>> Now my problem is that using R along doesn't produce any output. With
>> the above modification, I get:
>>
>> ,---
>> | Fatal error: you must specify '--save', '--no-save' or '--vanilla'
>> `---
>>
>> I'm quite close! If I add --no-save, I get exported results but they
>> include all of the R preamble text from when it starts. Here's my
>> block for reference:
>>
>> #+begin_src R :results output org :exports results
>>
>> x <- c(1:10)
>> summary(x)
>>
>> #+end_src
>>
>
> The default value for org-babel-R-command is "R --slave --no-save", so
> maybe adding the "--slave" option to your command will remove the R
> preamble text.

Yes! It's now working. I checked out the output of just runing "R"
from the command line in Windows, but did not see the --slave option.
Adding these to my .emacs setup of =org-babel-R-command= has worked
and it is now exporting results as expected.

Thanks so much -- for the times I need to use Windows at work, it's
going to be a lot easier to work with exportable/executable code
blocks in org-mode.


Thanks again for the persistence,
John

>
> As for your path problems, the "~" looks like a likely culprit.  The
> command is passed to an equivalent of the `shell-command-on-region'
> function, which then uses a shell to run the command.  Maybe the shell
> it uses can't handle the tilde?
>
> Best,
>
> p.s., I'm jumping into this thread part way through and didn't read all
>       of the back-log, so I apologize if I'm repeating previous advice.
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte

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

* Re: R and babel on Windows problem
  2012-07-06 18:45                         ` Nick Dokos
@ 2012-07-06 22:08                           ` John Hendy
  2012-07-06 22:14                             ` John Hendy
  0 siblings, 1 reply; 27+ messages in thread
From: John Hendy @ 2012-07-06 22:08 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Achim Gratz, emacs-orgmode

On Fri, Jul 6, 2012 at 1:45 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> On Fri, Jul 6, 2012 at 12:12 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>> > John Hendy <jw.hendy@gmail.com> wrote:
>> >
>> >> Any updates on this? Could someone provide a minimal example I could
>> >> try? Or verify that my steps above are correct. I'm not sure why it's
>> >> not triggering the step by step function execution described.
>> >>
>> >
>> > I had sent out a note about C-u C-M-x and what you should see in the
>> > echo area after that, but I don't think I've seen a reply: did you try
>> > that and did it work as expected?
>> >
>> > Either gmane is or I am being stupid right now and cannot find the message
>> > (maybe it never made it, but gmane cannot seem to find the thread at all
>> > right now), so I append a copy of that message.
>>
>> Yes. I guess I didn't explicitly say, but I mentioned that I had
>> triggered something goofy by accident in my earlier hunt for edebug.
>> I'll walkthrough right now:
>> - Got to ob-R.el in emacs
>> - C-s to find org-babel-R-evaluate-external-process
>> - C-u C-M-x
>> - Minibuffer: "Edebug: org-babel-R-evaluate-external-process"
>> - Visit file test.org
>> - C-c C-c on the src block
>> - Well... of course it works now. Not sure what I was doing wrong before.
>>
>
> The reason that I sent out that note was that you mentioned pressing M-x
> C-M-x (rather than C-u C-M-x) and getting the name of the function
> echoed (without the "Edebug: " part), so I wanted to make sure that you
> were DTRT here. Could that be what you were doing wrong? or was that a
> typo on your part?

Whoops -- yes, this was me probably making a typo. Or maybe the first
time around I was messing it up which is why it wasn't working. It
ended up working in the end.

>
>> I pressed space continually until failure, then again to verify the
>> failing line. It's this one (line 313):
>>
>> ,---
>> | (output (org-babel-eval org-babel-R-command body))))
>> `---
>>
>
> Just fyi and to clarify some basic lisp: the form
>
>      (org-babel-eval org-babel-R-command body)
>
> says: evaluate the org-babel-eval function with arguments
> org-babel-R-command and body (actually, those variables are evaluated
> first and then the *values* are passed to the function). The evaluation
> returns a result (a string in this case) which is assigned to the local
> variable output for further processing (local, because this whole thing
> is part of a let-form which is not shown in your snippet).
>
> I.e. a function call in lisp always looks like this:
>
>      (<func> <arg1> <arg2> ....)
>
>> When I run this line:
>>
>> ,---
>> | (org-babel-eval org-babel-R-command
>> `---
>>
>> I get this in the minibuffer:
>>
>> ,---
>> | Result: "C:/Progra~1/R/R-2.15.0/bin/R"
>> `---
>>
>
> I presume you just typed "e" when the cursor was after the variable:
> that just evaluates the variable. If you press SPACE then the cursor
> would advance to after the ``body'' variable (on the closing paren) and
> an "e" would evaluate *that* variable.  After another SPACE, the cursor
> would be *after* the closing paren and an "e" would evaluate the function
> call and you would see the result, i.e. what would be assigned to
> ``output''.
>

Maybe I didn't get edebug right. I just kept pressing space with no 'e'...

>> Should I be able to run this from the Windows cmd prompt successfully?
>> I think this is my problem. Even using tab completion to ensure the
>> path is correct, I get the same error message "The system cannot find
>> the path specified" when I run this from cmd!
>>
>> I guess I honed in on my problem. I can run R from my Start Menu shortcut fine.
>>
>> Update: I'm on 64bit and just now realized there's another set of R
>> cmds in ../R-2.15.0/bin/x64/. This is what I needed.
>>
>> Now my problem is that using R along doesn't produce any output. With
>> the above modification, I get:
>>
>> ,---
>> | Fatal error: you must specify '--save', '--no-save' or '--vanilla'
>> `---
>>
>> I'm quite close! If I add --no-save, I get exported results but they
>> include all of the R preamble text from when it starts. Here's my
>> block for reference:
>>
>> #+begin_src R :results output org :exports results
>>
>> x <- c(1:10)
>> summary(x)
>>
>> #+end_src
>>
>
> OK, at this point I will "exit, stage left, chased by a bear", since
> both Windoze and R are within my areas of almost complete ignorance :-)
>

No worries and serious thanks for bearing with me. Eric got it with
the options to pass via the org-babel-R-command variable. Since the
default includes --slave and --no-save and I changed it, I needed to
add that to my custom setting of the variable.


Thanks again!
John

> Nick
>
>>
>>
>> Thanks,
>> John
>>
>>
>> >
>> > Nick
>> >
>> >
>> > John Hendy <jw.hendy@gmail.com> wrote:
>> > ...
>> >> >
>> >> > Oh, sorry: edebug is described in
>> >> >
>> >> > (info "(elisp) Edebug")
>> >> >
>> >> > The basics: visit ob-R.el, go to the org-babel-R-evaluate-external-process
>> >> > definition and press C-u C-M-x. Then do whatever you were doing to get the
>> >> > problem. It should stop at the function and you can single-step by pressing
>> >> > SPACE. At strategic points, you can evaluate things with "e".
>> >>
>> >> Eeks. Is the fact that I learned emacs only for org-mode showing. I
>> >> don't even know how to =(info "(elisp) Edebug")= -- do I put an =M-x=
>> >> in front of that? =M-x info= seems to bring me to a help page for
>> >> info!
>> >>
>> >
>> > You have to evaluate it somehow. If you are reading your mail in emacs,
>> > just place the cursor after the closing paren and press C-x C-e. If not,
>> > just go to emacs and "C-h i elisp RET i edebug RET" or equivalently,
>> > type ESC ESC : (info "(elisp) Edebug") RET. Underlying assumption: you
>> > have the Emacs Lisp info files installed.
>> >
>> >> Anyway... I just googled edebug and it says about the same as you did
>> >> (except for appending "eval-defun with a prefix argument" onto =C-u
>> >> C-M-x=.
>> >> - http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Edebug.html
>> >>
>> >> Anyway:
>> >> - Visited ob-R.el in emacs
>> >> - Found org-babel-R-evaluate-external-process
>> >> - Put the cursor on the line =(defun org-babel-R-evaluate-external-process=
>> >> - Did =M-x C-M-x= and the minibuffer echoed the name of the function
>> >
>> > C-u C-M-x please: and the echo area should say "Edebug:
>> > org-babel-R-evaluate-external-process" afterwards.
>> >
>> > Nick
>> >
>> >> - Visited my file, test.org and did =C-c C-c= on the R babel block
>> >> - Nothing different occurred; I just got "The system cannot find the
>> >> path specified"
>> >>
>> >> I tried the above again with regular 'ol org-babel-R-evaluate just in
>> >> case and had the same results.
>> >>
>> >> I'm clearly goofing something but have no idea what it is.
>> >>
>> >>
>> >> John
>> >>
>> >>
>> >> >
>> >> > If you mess it up (and you probably will a few times), no problem: just try
>> >> > again. And be patient!
>> >> >
>> >> > Good luck,
>> >> > Nick
>> >> >
>> >> >
>> >> >
>> >> >>
>> >> >> John
>> >> >>
>> >> >>
>> >> >> >
>> >> >> > Nick
>> >> >> >
>> >> >> >> Using =M-x R= works find. ESS is finding R. I successfully loaded a
>> >> >> >> .csv, ggplot2 and plotted.
>> >> >> >>
>> >> >> >>
>> >> >> >> John
>> >> >> >>
>> >> >> >> John
>> >> >> >>
>> >> >> >> >
>> >> >> >> > Nick
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> >
>> >
>>

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

* Re: R and babel on Windows problem
  2012-07-06 22:08                           ` John Hendy
@ 2012-07-06 22:14                             ` John Hendy
  2012-07-07  1:02                               ` Eric Schulte
  2012-07-07  1:48                               ` Nick Dokos
  0 siblings, 2 replies; 27+ messages in thread
From: John Hendy @ 2012-07-06 22:14 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Achim Gratz, emacs-orgmode

Jeepers. If I had just followed through with the outcome of the thread
we were *both* already on!
- http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00131.html

Of course I find it only after having this drawn out troubleshooting exercise.

I looked as I thought I could find a Worg page this might fit on... If
it sounds good, I'll add a note for Windows users on ob-doc-R:
- http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html

Sound good? I can point to both mailing list entries and note my need
for a custom path due to 64bit setup and making sure to include the
right arguments to the R command.


John

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

* Re: R and babel on Windows problem
  2012-07-06 22:14                             ` John Hendy
@ 2012-07-07  1:02                               ` Eric Schulte
  2012-07-07  1:48                               ` Nick Dokos
  1 sibling, 0 replies; 27+ messages in thread
From: Eric Schulte @ 2012-07-07  1:02 UTC (permalink / raw)
  To: John Hendy; +Cc: Achim Gratz, nicholas.dokos, emacs-orgmode

John Hendy <jw.hendy@gmail.com> writes:

> Jeepers. If I had just followed through with the outcome of the thread
> we were *both* already on!
> - http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00131.html
>
> Of course I find it only after having this drawn out troubleshooting exercise.
>
> I looked as I thought I could find a Worg page this might fit on... If
> it sounds good, I'll add a note for Windows users on ob-doc-R:
> - http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html
>
> Sound good? I can point to both mailing list entries and note my need
> for a custom path due to 64bit setup and making sure to include the
> right arguments to the R command.
>

Yes, please do add this to worg.  If it will help others who run into
this same issue it will definitely be worthwhile.

Thanks,

>
>
> John
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

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

* Re: R and babel on Windows problem
  2012-07-06 22:14                             ` John Hendy
  2012-07-07  1:02                               ` Eric Schulte
@ 2012-07-07  1:48                               ` Nick Dokos
  2012-07-16  0:42                                 ` John Hendy
  1 sibling, 1 reply; 27+ messages in thread
From: Nick Dokos @ 2012-07-07  1:48 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

John Hendy <jw.hendy@gmail.com> wrote:

> Jeepers. If I had just followed through with the outcome of the thread
> we were *both* already on!
> - http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00131.html
> 
> Of course I find it only after having this drawn out troubleshooting exercise.
> 

But you would have missed all the fun :-)

I didn't even remember this thread: my involvement was a complete
surprise - not sure whether that's a :-) or a :-( ...

> I looked as I thought I could find a Worg page this might fit on... If
> it sounds good, I'll add a note for Windows users on ob-doc-R:
> - http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html
> 
> Sound good? I can point to both mailing list entries and note my need
> for a custom path due to 64bit setup and making sure to include the
> right arguments to the R command.
> 

What Eric said: anything that would make it easier in the future is worth it.

Nick

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

* Re: R and babel on Windows problem
  2012-07-07  1:48                               ` Nick Dokos
@ 2012-07-16  0:42                                 ` John Hendy
  0 siblings, 0 replies; 27+ messages in thread
From: John Hendy @ 2012-07-16  0:42 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

As promised, I updated Worg. It should cover the main things that came up here:
- Setting the custom path via org-babel-R-command
- Passing =--slave --no-save= when setting the command
- The /path/to/R/bin/x64/R nuance for 64bit Windows

http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html#sec-2-1


Thanks again for all the help!
John

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

end of thread, other threads:[~2012-07-16  0:42 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-28 17:46 R and babel on Windows problem John Hendy
2012-06-29 14:59 ` Alexander Vorobiev
2012-06-29 15:24   ` John Hendy
2012-06-29 17:12     ` Alexander Vorobiev
2012-06-29 18:26 ` Achim Gratz
2012-06-29 19:31   ` John Hendy
2012-06-29 19:37     ` Nick Dokos
2012-06-29 20:00       ` John Hendy
2012-06-29 20:16         ` Nick Dokos
2012-07-02 20:15           ` John Hendy
2012-07-02 21:26             ` Nick Dokos
2012-07-02 21:47               ` John Hendy
2012-07-02 22:15                 ` Nick Dokos
2012-07-02 22:16                 ` John Hendy
2012-07-06 16:58                   ` John Hendy
2012-07-06 17:12                     ` Nick Dokos
2012-07-06 17:46                       ` John Hendy
2012-07-06 18:41                         ` Eric Schulte
2012-07-06 22:05                           ` John Hendy
2012-07-06 18:45                         ` Nick Dokos
2012-07-06 22:08                           ` John Hendy
2012-07-06 22:14                             ` John Hendy
2012-07-07  1:02                               ` Eric Schulte
2012-07-07  1:48                               ` Nick Dokos
2012-07-16  0:42                                 ` John Hendy
2012-06-30  5:13     ` Achim Gratz
2012-06-30 13:15       ` Eric Schulte

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