Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
0answers
12 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 ...
1
vote
0answers
14 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
1answer
21 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 ...
0
votes
1answer
70 views

org-babel-execute-src-block: No org-babel-execute function for R!

In org-mode, attempting to execute the following block... #+BEGIN_SRC R 1+2 #+END_SRC ...gives the error message org-babel-execute-src-block: No org-babel-execute function for R!. I have followed ...
1
vote
1answer
15 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
29 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
52 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 ...
0
votes
0answers
47 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 ...
0
votes
0answers
192 views

ESS R error: searching for program

I have installed emacs on windows 10 working ok so far. Installed R and ESS. Set system and user path to Rterm.exe as read in some forums. Restarted and opened a R file in emacs. Syntax coloring is ...
1
vote
1answer
82 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
0answers
23 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
50 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) ...
0
votes
1answer
53 views

Printing tibbles in iESS with many columns extremely slow

When I print large tibbles from R it takes a very long time and the iESS buffer runs extremely slowly thereafter (huge lag moving the cursor throughout the buffer or typing). The code below takes 5 ...
2
votes
1answer
109 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 ...
1
vote
1answer
270 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 ...
0
votes
0answers
58 views

How to get the frequency of word-pairs, word-triples, and so on, in a buffer?

Having as input: neque porro quisquam neque porro How to get the output: | word(s) | occurrences | |----------------------+-------------| | neque | 2 | | ...
1
vote
1answer
62 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?
6
votes
3answers
318 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=...
3
votes
1answer
1k 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 <...
1
vote
1answer
235 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,...
0
votes
0answers
139 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 ...
4
votes
1answer
62 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
316 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
2answers
203 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) ...
0
votes
1answer
71 views

How Do you export only R code from Rnw file

I am working with knitr, polymode, ess and I would like to export just the R code from my .Rnw into a .R file. A basic file might look something like this: \documentclass[a4paper]{article} My Rnw ...
3
votes
0answers
242 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 ...
0
votes
1answer
207 views

Org babel caching for R when using session

I have an file which is a research paper (here); it contains numerous R blocks which produce tables and figures. Since these share common data and preliminary calculations, they are run as a org-babel ...
0
votes
2answers
56 views

How to avoid redundant output from inline orgbabel code?

When using #Begin_Src R blocks one can change the code in blocks and then rerun all the code blocks in a document. Great. However, if one does this with inline src, such as, src_R[:session *...
1
vote
2answers
771 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 * ...
3
votes
1answer
1k 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: ...
2
votes
1answer
147 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 ...
3
votes
1answer
2k 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 ...
6
votes
2answers
136 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
1answer
474 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 :...
1
vote
1answer
155 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
0answers
157 views

ESS ignores R_LIBS_USER environment variable

I have the following in my .bashrc export R_LIBS_USER="/home/wdkrnls/R/lib/3.2" When I start R from the shell I see (even in Emacs M-x shell): .libPaths() [1] "/home/wdkrnls/R/lib/3.2" "/usr/lib/R/...
1
vote
1answer
400 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). ...
5
votes
1answer
68 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 ...
2
votes
0answers
86 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
1answer
140 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?
14
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+...
2
votes
1answer
211 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 ...
3
votes
3answers
338 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 ...
6
votes
0answers
626 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 ...
3
votes
1answer
93 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?
6
votes
1answer
380 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 ...
31
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 ...
4
votes
1answer
387 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 (...