Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pop-up windows in R & Emacs

Tags:

emacs

r

ess

I am using ESS in order to stay in Emacs when working with R. Whenever I create a plot a new pop-up appears with the graph. This new window seems to be a part of the R process called inside Emacs. As such the new window is not part of the buffer-list and seems to lie outside the Emacs environment.

Can a new window created by R, containing e.g. graphs called by plot() or respective functions in ggplot2/lattice, be forced to stay inside the Emacs environment? So that the plot is available as a new buffer.

Thanks!

like image 214
mropa Avatar asked Feb 19 '11 20:02

mropa


2 Answers

This is unlikely to be the solution you are looking for as it involves turning Emacs into a window manager (works for Linux and MacOS): the package EXWM (Emacs X Window Manager) is a full-featured tiling window manager that turns all X windows into Emacs buffers.

Here is an example of what that would look like (note the R Graphics window on the right which is now an Emacs buffer):

enter image description here

This allows you to use Emacs keybindings, configuration, etc. to all X windows.

like image 58
prosoitos Avatar answered Sep 19 '22 04:09

prosoitos


This does not exactly answer the OP's question because this goes outside of ESS but it still may be relevant to some because it still relates to using R to generate graphics that can be viewed inside of Emacs.

You can do this using Emacs iPython Notebook (ein). You have to set up Jupyter first but after that it's pretty straightforward and can work with different kernels (R, Python, Julia, etc.). Below is a screenshot

Screenshot of R plot in ein

like image 45
Stefan Avey Avatar answered Sep 23 '22 04:09

Stefan Avey