We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [r]

R is a free software environment for statistical computing and graphics. R can be run from within Emacs using the ESS (Emacs Speaks Statistics) package, which also provides a major mode for editing `.R` files.

Filter by
Sorted by
Tagged with
33
votes
2answers
2k views

ESS plot directly to an Emacs buffer?

Q: how can I get ESS (R) to plot directly to an Emacs buffer? When interacting with R through ESS, R defaults to spawning a separate graphics window outside of Emacs to draw its plots. (One can, of ...
18
votes
2answers
3k views

how to setup Knitr workflow in Emacs?

RStudio provides a one-button way for produce PDF file from LaTeX+R source with Knitr. It looks great for doing reproducible research. And I am trying to configure my Emacs for: at left buffer LaTeX+...
6
votes
3answers
501 views

Using constants inline

How to do the following in org-mode: define a constant in the beginning of file, and than use it in the text or even compute on it. Following methods didn't work for me: Method 1: #+CONSTANTS: t=...
6
votes
1answer
471 views

How to implement comments outline in ESS similar to that of Rstudio?

Shifting from Rstudio to ESS took some time with me because of the steep learning curve of a versatile Emacs editor, but is was a worthwhile experience. What I am still missing in ESS is that outline ...
6
votes
0answers
736 views

How to find what causes ESS to run very slow?

When working with an iESS session of R and an R file open side-by-side, I noticed extremely slow performance when typing indetifiers. Typing braces and operators is fine, however, when an identifier ...
5
votes
1answer
181 views

Emacs busy while evaluating R in ESS

When using Emacs with ESS, when I evaluate functions that take longer to complete (reading in larger files or executing SQL queries), the whole Emacs becomes busy (freezes, hangs, crashes - whatever ...
5
votes
2answers
161 views

unset an org-babel property?

In org-mode, if I set the :file header-arg at some point, like all header args, it is inherited at lower levels. I want to avoid duplicating the header-arg all over. In the case of :session, the ...
4
votes
3answers
393 views

Display org-mode src R results horizontally

Is there a way to show the results of a Source Block horizontally, or equivalently to transpose an org-table? For example, I have the following: #+begin_src R :results table c('a','b','c') #+end_src ...
4
votes
1answer
405 views

ESS indentation of parentheses after =?

Indentation in ESS is occasionally a little kooky, and I'm trying to figure out if the kookiness is a bug or a feature. How does one get proper indentation of parentheses after an "=" sign in ESS (...
4
votes
1answer
2k views

export R code results in org-mode?

I want to execute R code blocks in org-mode and export the results to a PDF/html. Here is an example: Some text here... #+begin_src R :results output latex library(xtable) x <- rnorm(100) y <...
4
votes
1answer
732 views

setting an org mode property header doesn't work for the first one

I cannot seem to set #+PROPERTY: header-args:R as the first value and have it work the way I expect it to. This is used as an example for org-mode here. Setting a language specific property for :...
4
votes
1answer
87 views

ESS: getting help on package

Is it possible to get ESS to display results of help(package=xxx) in a new buffer, like it does for ?xxx?
4
votes
1answer
94 views

ESS: Disable spaces around `=` in function arguments

With ESS + auto-complete, I get AC suggestions for function arguments that allow me to save time typing them out. What irks me is that it completes the function arguments with spaces around them. For ...
4
votes
1answer
370 views

ESS freezes on startup with ess-tracebug mode enabled

I am currently running R 3.3.1 in emacs 25.1.1, ESS 16.10, and polymode 20160805.448 installed via MELPA on Mac OS Sierra. Whenever I try to open an interactive R console using M-x R, it freezes ...
3
votes
1answer
2k views

graphing R in org-babel

How can I get a graph back in my org-babel results for R code? #+BEGIN_SRC R :results output latex boxplot(islands) #+END_SRC Islands is a baked in dataset for R. Do you do it with #+resname: ...
3
votes
1answer
137 views

How to control which iESS process gets a code evaluation?

I have several R instances running and want to pick which one gets the evaluations in my buffer. Is there a built-in way of doing this?
3
votes
1answer
64 views

Run R code on selected object

I am missing (or not aware) of a feature in ESS to run some R code on selected text. When editing a script, like df1 <- data.frame(a=1:100,b=rnorm(100)) I often want to see head(df1) in my ...
3
votes
1answer
115 views

How to get documentation link in ESS R?

In RStudio, the documentation pane display not just the help file but also links to other help files (see link to aov below). How to get the same in ESS R?
3
votes
1answer
39 views

How to copy output from ess to the kill ring?

Q: how can I automatically copy output from ess to the kill ring? Background I use ess to conduct statistical analysis. On occasion, I need to copy its raw output into another buffer (usually ...
3
votes
1answer
114 views

How to display *help* buffers below one specific window?

I am (really) new in Emacs and ESS, and I am currently trying to customize my environment. The default settings of ESS[R] are convenient for me, since ESS[R] organizes the windows as follows: --------...
3
votes
0answers
166 views

“error in process sentinel” whenever using %>% in an ESS R buffer

Whenever I include a pipe (%>%) in a ESS R buffer, I start getting the following error repeatedly, with lags that make editing almost impossible: error in process sentinel: Not enough arguments ...
3
votes
0answers
314 views

set breakpoint while in debugger?

Is it possible to set a breakpoint on an arbitrary line while already established in browser()? As a use-case: if I debug(myfunc) and while in Browse[2]> ... I realize that I need to jump forward ...
2
votes
1answer
358 views

New frame does not respect default font

I use Emacs mostly to write R using ESS. I like a large font to reduce eye strain so the last line of my .emacs file is: (set-default-font "Inconsolata-20") If I open a file of R code, this appears ...
2
votes
1answer
3k views

Exporting code blocks to pdf via LaTeX

I am writing a report in org mode and would like to show some code blocks as seen in so many tutorials. Here is some official documentation, however it was written for org-mode 6.xx back in 2011. I ...
2
votes
1answer
177 views

ess-mode library name auto-complete

I've been looking around for a solution to get company-mode to auto-complete R library names in ess-mode. The R libraries are stored in folders with the same name, wouldn't it be just the case of ...
2
votes
2answers
264 views

Changing HTML Table Formatting When Exporting from R

I am generating several tables in R and then exporting them to HTML(5). For instance: #+BEGIN_SRC R :session *R-org* :results output raw :exports results df <- data.frame(x=0.110, y=0.132) ...
2
votes
1answer
167 views

Why does inserting a new R chunk inside `ess-noweb-mode` give me a leading @ symbol?

I am writing a statistical report using .Rnw buffer and enjoying the very nice ess-noweb-mode, which I see very promising indeed, but what struck me is the strange behavior when I hit the keybinding ...
2
votes
1answer
470 views

Org mode: execute region in session

I'm looking for an easy way to highlight a chunk of text inside a Babel source block (not the entire block) and execute that inside the current session (creating the new session buffer if necessary). ...
2
votes
0answers
31 views

gnu screen emacs ess: M-X R freeze

I just pick up emacs after a while with Vim. This is run on CentOS server. I ssh to the server, and start with gnu screen, and emacs ess, when I start to run R, emacs just freeze. Here is what I ...
2
votes
0answers
99 views

How to specify number of digits to print from a table using babel?

New to org/babel, so forgive me if this doesn't make sense. I have some code (in R) that produces a table. I also specify (in R) the number of digits that I want with options(digits = 2). When I run ...
1
vote
2answers
982 views

Reference a variable in a 2nd org-babel code block

How can I define vars in one org-babel code block and use them in a second? This closely follows the tutorial section block-to-block variable passing linked in the first answer. # file test.org * ...
1
vote
1answer
45 views

How to create shortcut that will kill process for buffer with fixed name

I have code like this to run R command from Emacs: (defun call-r-command (command-list) "run R command in shell buffer window if there is displayed buffer that have shell it will use that window"...
1
vote
1answer
33 views

Org babel R: why is 'NA' replaced with 'nil'

When using R in org mode source blocks, any NA (i.e. missing) values in tables get replaced with nil. Why is this? And is there a way to change this (globally, or at the file level)? I regularly ...
1
vote
1answer
42 views

Polymode changes from ESS-mode to Markdown-mode whenever I press enter

When I am editing .Rmd file within a polymode chunk, the mode switches from ESS to Markdown mode whenever I press enter. However, it switches back to ess-mode whenver I save the file. I will try ...
1
vote
1answer
55 views

emacs opens ESS/R buffer in random window

I'm using emacs 26.1 with ESS. Whenever I open a R session with M-x R it opens in a random window. However, I would like it to open in the currently selected window. It seems to be a similar issue as ...
1
vote
1answer
160 views

How to jump to R source code with ESS?

Q: how can I get to the source code of R packages using ESS? When I'm working with elisp, I can access the source code for any package easily with find-library or by following the links in find-...
1
vote
1answer
156 views

Tramp and X11 forwarding when changing user (su)

I can connect to a remote server with Tramp C-x C-f /ssh:group@remotehost: and get a plot output window (with ess R). But if I change user C-x C-f /ssh:group@remote|su:user@remote: there's no X11 ...
1
vote
1answer
109 views

ESS failed to run: ess-s-define-runners is void

After upgrading packages in emacs, I have the following error message when trying to run R (M-x R): Symbol's function definition is void: ess-s-define-runners. I can't find where the error is. Here's ...
1
vote
1answer
355 views

Pass variable from src block to org-edit-src-code

I have a table in org-mode that I want to pass into an R source block and then plot from it. When I write everything in org-mode and execute it, I get the results that I expect. However, when I enter ...
1
vote
1answer
318 views

ess R startup warning locale

I am using Emacs 25.1.1 with spacemacs. Everytime I run iESS, I get the warning about locale as, During startup - Warning messages: 1: Setting LC_CTYPE failed, using "C" 2: Setting LC_COLLATE failed,...
1
vote
1answer
197 views

Org babel R : can't find org-R-apply

following the tutorial http://orgmode.org/worg/org-tutorials/org-R/org-R.html, I get stuck because I can't find the function org-R-apply. I have R installed on my computer and the package ess has ...
1
vote
1answer
162 views

ESS - how to disable sublimity mode for R console only?

Is there a way to keep sublimity mode for R source buffers, while disabling it for the R console?
1
vote
0answers
61 views

Can we get inline results with polymode for Rmd files?

As a new Emacs user, I've recently learned how to use polymode to handle R code in org-mode. I'm happy with it, since I get the same features than those implemented for example in Rstudio for Rmd ...
1
vote
0answers
33 views

Setting up Knittr workflow in Emacs [duplicate]

I was a happy ESS and R user to obtain tex and pdf files from Rnw file with sweave and knitr. I have followed the answer given here, everything worked fine but after several updates or maybe new ...
1
vote
0answers
118 views

Missing RMarkdown templates with poly-R

I use the ess, polymode, and poly-R packages together to work with RMarkdown files. I have also installed the R packages rmarkdown and tufte in my R library. While these R packages provide ".Rmd" ...
1
vote
0answers
44 views

R in ESS outputs UTF-8, which emacs renders raw

I find the question but no answer at Emacs ESS R - Message Content Encoding and Display Issue. In buffer *R*, the R process uses UTF-8 encoding for its output. However emacs does not decode that ...
1
vote
0answers
110 views

R (ESS) freezes emacs when asking for project directory

Using Windows. Fresh install of emacs 2.6. The installation of R CLI and R studio worked ok. No issues. I open R files on emacs and ESS mode is properly set on modeline but when I try to execute/eval ...
1
vote
0answers
33 views

ESS folding for R6 classes

What is the proper way to install, configure and activate folding of R script files? I followed emacswiki.org/emacs/FoldingMode but it doesn't seems to work. I installed folding.el to .emacs/lisp/. ...
1
vote
0answers
65 views

Save org-babel output with org-attach

I am using org-babel to write R code in Emacs org-mode. Here's an example: #+BEGIN_SRC R :session *R* :results output graphics :width 5 :height 5 data(AirPassengers) AP <- AirPassengers plot(AP) ...
1
vote
0answers
177 views

Get company completion without evaluation in ess

Is it possible to do completion without evaluating the buffer in ess-mode/R-mode which uses company-R-objects and company-R-args as backends ? Backends like company-jedi can do completion without ...