emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* R code blocks in org version 9.5
@ 2022-10-18 23:48 Naresh Gurbuxani
  2022-10-19  3:14 ` William Denton
  0 siblings, 1 reply; 7+ messages in thread
From: Naresh Gurbuxani @ 2022-10-18 23:48 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Recently I started using org version 9.5 with my init.el that worked well for org 9.4

In org 9.5, I can run stand-alone R code blocks.  But when I try to run them in a session, emacs hangs.

Have you seen this problem? Is there a solution?

Thanks,
Naresh

Sent from my iPhone

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

* Re: R code blocks in org version 9.5
  2022-10-18 23:48 R code blocks in org version 9.5 Naresh Gurbuxani
@ 2022-10-19  3:14 ` William Denton
  2022-10-19 12:59   ` Naresh Gurbuxani
  0 siblings, 1 reply; 7+ messages in thread
From: William Denton @ 2022-10-19  3:14 UTC (permalink / raw)
  To: Naresh Gurbuxani; +Cc: emacs-orgmode@gnu.org

On 18 October 2022, Naresh Gurbuxani wrote:

> Recently I started using org version 9.5 with my init.el that worked well for org 9.4
>
> In org 9.5, I can run stand-alone R code blocks.  But when I try to run them in a session, emacs hangs.

I haven't had any problems like that, and I use R session code blocks pretty 
much every day.  Can you narrow it down any?  Does even the most basic block, 
just adding 1 + 1, not work?  What about with emacs -Q?


Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada


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

* Re: R code blocks in org version 9.5
  2022-10-19  3:14 ` William Denton
@ 2022-10-19 12:59   ` Naresh Gurbuxani
  2022-10-19 13:27     ` Naresh Gurbuxani
  2022-10-19 16:52     ` Cook, Malcolm
  0 siblings, 2 replies; 7+ messages in thread
From: Naresh Gurbuxani @ 2022-10-19 12:59 UTC (permalink / raw)
  To: William Denton; +Cc: emacs-orgmode@gnu.org

Thanks to your suggestion, I was able to narrow down the problem.

My R code blocks work fine in org 9.5. When I plot graph using base graphics in session, it works fine.  The problem is with lattice graphs. With below header variables, code block works fine.

#+begin_src R :session *R* :results graphics file :file test.png
library(lattice)
print(histogram(rnorm(10000)))
#+end_src

But this does not work.  Emacs hangs.

#+begin_src R :session *R* :results output graphics file :file test.png
library(lattice)
histogram(rnorm(10000))
#+end_src

I can simply add print command to my code blocks.  Is there an easier solution?

Naresh

Sent from my iPhone

> On Oct 18, 2022, at 11:14 PM, William Denton <wtd@pobox.com> wrote:
> 
> On 18 October 2022, Naresh Gurbuxani wrote:
> 
>> Recently I started using org version 9.5 with my init.el that worked well for org 9.4
>> 
>> In org 9.5, I can run stand-alone R code blocks.  But when I try to run them in a session, emacs hangs.
> 
> I haven't had any problems like that, and I use R session code blocks pretty much every day.  Can you narrow it down any?  Does even the most basic block, just adding 1 + 1, not work?  What about with emacs -Q?
> 
> 
> Bill
> 
> --
> William Denton
> https://www.miskatonic.org/
> Librarian, artist and licensed private investigator.
> Toronto, Canada

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

* Re: R code blocks in org version 9.5
  2022-10-19 12:59   ` Naresh Gurbuxani
@ 2022-10-19 13:27     ` Naresh Gurbuxani
  2022-10-19 13:55       ` Colin Baxter
  2022-10-19 14:23       ` William Denton
  2022-10-19 16:52     ` Cook, Malcolm
  1 sibling, 2 replies; 7+ messages in thread
From: Naresh Gurbuxani @ 2022-10-19 13:27 UTC (permalink / raw)
  To: William Denton; +Cc: emacs-orgmode@gnu.org

It seems that org 9.5 has simplified header arguments for R code blocks that use grid graphics.

Org 9.4 requires
:results output graphics file

Org 9.5 requires
:results output file

Do other users find the same change?

Sent from my iPhone

> On Oct 19, 2022, at 8:59 AM, Naresh Gurbuxani <naresh_gurbuxani@hotmail.com> wrote:
> 
> Thanks to your suggestion, I was able to narrow down the problem.
> 
> My R code blocks work fine in org 9.5. When I plot graph using base graphics in session, it works fine.  The problem is with lattice graphs. With below header variables, code block works fine.
> 
> #+begin_src R :session *R* :results graphics file :file test.png
> library(lattice)
> print(histogram(rnorm(10000)))
> #+end_src
> 
> But this does not work.  Emacs hangs.
> 
> #+begin_src R :session *R* :results output graphics file :file test.png
> library(lattice)
> histogram(rnorm(10000))
> #+end_src
> 
> I can simply add print command to my code blocks.  Is there an easier solution?
> 
> Naresh
> 
> Sent from my iPhone
> 
>>> On Oct 18, 2022, at 11:14 PM, William Denton <wtd@pobox.com> wrote:
>>> 
>>> On 18 October 2022, Naresh Gurbuxani wrote:
>>> 
>>> Recently I started using org version 9.5 with my init.el that worked well for org 9.4
>>> 
>>> In org 9.5, I can run stand-alone R code blocks.  But when I try to run them in a session, emacs hangs.
>> 
>> I haven't had any problems like that, and I use R session code blocks pretty much every day.  Can you narrow it down any?  Does even the most basic block, just adding 1 + 1, not work?  What about with emacs -Q?
>> 
>> 
>> Bill
>> 
>> --
>> William Denton
>> https://www.miskatonic.org/
>> Librarian, artist and licensed private investigator.
>> Toronto, Canada

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

* Re: R code blocks in org version 9.5
  2022-10-19 13:27     ` Naresh Gurbuxani
@ 2022-10-19 13:55       ` Colin Baxter
  2022-10-19 14:23       ` William Denton
  1 sibling, 0 replies; 7+ messages in thread
From: Colin Baxter @ 2022-10-19 13:55 UTC (permalink / raw)
  To: Naresh Gurbuxani; +Cc: William Denton, emacs-orgmode@gnu.org

>>>>> Naresh Gurbuxani <naresh_gurbuxani@hotmail.com> writes:

    > It seems that org 9.5 has simplified header arguments for R code
    > blocks that use grid graphics.

    > Org 9.4 requires :results output graphics file

    > Org 9.5 requires :results output file

    > Do other users find the same change?

    > Sent from my iPhone

    >> On Oct 19, 2022, at 8:59 AM, Naresh Gurbuxani
    >> <naresh_gurbuxani@hotmail.com> wrote:
    >> 
    >> Thanks to your suggestion, I was able to narrow down the problem.
    >> 
    >> My R code blocks work fine in org 9.5. When I plot graph using
    >> base graphics in session, it works fine.  The problem is with
    >> lattice graphs. With below header variables, code block works
    >> fine.
    >> 
    >> #+begin_src R :session *R* :results graphics file :file test.png
    >> library(lattice) print(histogram(rnorm(10000))) #+end_src
    >> 
    >> But this does not work.  Emacs hangs.
    >> 
    >> #+begin_src R :session *R* :results output graphics file :file
    >> test.png library(lattice) histogram(rnorm(10000)) #+end_src
    >> 
    >> I can simply add print command to my code blocks.  Is there an
    >> easier solution?

I'm afraid both your above examples work for me. I'm on emacs-29.0.50
and org-mode version 9.6-pre (release_9.5.5-995-g4b9aef)

Best wishes


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

* Re: R code blocks in org version 9.5
  2022-10-19 13:27     ` Naresh Gurbuxani
  2022-10-19 13:55       ` Colin Baxter
@ 2022-10-19 14:23       ` William Denton
  1 sibling, 0 replies; 7+ messages in thread
From: William Denton @ 2022-10-19 14:23 UTC (permalink / raw)
  To: Naresh Gurbuxani; +Cc: emacs-orgmode@gnu.org

On 19 October 2022, Naresh Gurbuxani wrote:

> It seems that org 9.5 has simplified header arguments for R code blocks that use grid graphics.
>
> Org 9.4 requires
> :results output graphics file
>
> Org 9.5 requires
> :results output file
>
> Do other users find the same change?

They both work for me, though I've never put "output" in such a block: I always 
use ":results graphics file".


Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada


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

* RE: R code blocks in org version 9.5
  2022-10-19 12:59   ` Naresh Gurbuxani
  2022-10-19 13:27     ` Naresh Gurbuxani
@ 2022-10-19 16:52     ` Cook, Malcolm
  1 sibling, 0 replies; 7+ messages in thread
From: Cook, Malcolm @ 2022-10-19 16:52 UTC (permalink / raw)
  To: Naresh Gurbuxani, William Denton; +Cc: emacs-orgmode@gnu.org

> My R code blocks work fine in org 9.5. When I plot graph using base graphics in session, it works fine. The problem is with lattice graphs. With below header variables, code block works fine.
> 
> #+begin_src R :session *R* :results graphics file :file test.png
> library(lattice)
> print(histogram(rnorm(10000)))
> #+end_src
> 
> But this does not work. Emacs hangs.
> 
> #+begin_src R :session *R* :results output graphics file :file test.png
> library(lattice)
> histogram(rnorm(10000))
> #+end_src

In my hands, all combinations work with/without the `output` and with/without the `print`.

IMO, you should not want to include the print. 

Here is my environment:

Org mode version 9.5.2 (release_9.5.2-9-g7ba24c)

GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.15.12, Xaw3d scroll bars) of 2022-01-19

ESS version 18.10.3snapshot

R
sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS:   /n/apps/CentOS7/install/r-4.2.0/lib64/R/lib/libRblas.so
LAPACK: /n/apps/CentOS7/install/r-4.2.0/lib64/R/lib/libRlapack.so

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] lattice_0.20-45

loaded via a namespace (and not attached):
[1] compiler_4.2.0 grid_4.2.0    

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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-18 23:48 R code blocks in org version 9.5 Naresh Gurbuxani
2022-10-19  3:14 ` William Denton
2022-10-19 12:59   ` Naresh Gurbuxani
2022-10-19 13:27     ` Naresh Gurbuxani
2022-10-19 13:55       ` Colin Baxter
2022-10-19 14:23       ` William Denton
2022-10-19 16:52     ` 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).