Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
0answers
16 views

Is it possible to export R code within Latex code in an org-mode document?

I am trying to evaluate R code within LaTeX code in an org-mode document. The objective is to export the org-mode document to a .tex document and, ultimately, to a nice pdf document. My problem is ...
0
votes
0answers
24 views

How to “manipulate” using R in Emacs

In Rstudio one can use library manipulate to interactively change the plot over some parameters(mu). When you use this in emacs ESS it gives error: function(mu){ plot(mu) } manipulate(myfunc(mu),mu = ...
1
vote
1answer
25 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
0answers
21 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
1answer
30 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
0answers
36 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
22 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 ...
0
votes
0answers
15 views

Rmarkdown-like export of Leaflet for R webmap to html from org-mode

With RMarkdown it's easy to embed an interactive webmap. E.g.: --- title: Some title output: rmarkdown::html_document --- ```{r} library(leaflet) leaflet(width = "100%", height = "650px") %>%...
2
votes
0answers
25 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 ...
3
votes
0answers
91 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
32 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
310 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
22 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
70 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
99 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
0answers
84 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
1answer
414 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
97 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
31 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
60 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
65 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
144 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
301 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
78 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
395 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
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 <...
1
vote
1answer
275 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
155 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 ...
5
votes
1answer
77 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
345 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
227 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
86 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
274 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
242 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
58 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
852 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
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: ...
2
votes
1answer
153 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
146 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
565 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
180 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
169 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/...
2
votes
1answer
426 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
83 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
91 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
152 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?
17
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
280 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
365 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 ...