18 votes
Accepted

export R code results in org-mode?

You need to use the :exports both header argument. By default, org only exports R code, not the results. From the org manual: 14.8.2.8 :exports The :exports header argument is to specify if that part ...
Tyler's user avatar
  • 22.3k
13 votes

Emacs busy while evaluating R in ESS

While doing due research on this, I stumbled upon a small section in the ESS manual: The default value of ess-eval-visibly (t) means that ESS calls block Emacs until they finish. This may be ...
Liudvikas Akelis's user avatar
11 votes
Accepted

Exporting code blocks to pdf via LaTeX

You have to tell org-mode to actually use the listings or listingsutf8 package in your .emacs: (add-to-list 'org-latex-packages-alist '("" "listingsutf8")) Then you'll have a line \usepackage{...
Robert Klein's user avatar
7 votes
Accepted

Using constants inline

Try this Define t as default header argument with using :var t=10 #+PROPERTY: header-args:R :var t=10 The temperature is src_R{2*t}, and twice of that is src_R{4*t}. Note: Fixed typo in second ...
Melioratus's user avatar
  • 4,644
7 votes
Accepted

Using org-table data for R block

You can pass the table name to a variable in the R block header: #+NAME:amount | date | amount |------------------+--------| | <2022-01-30 Sun> | 55.1 | | <2022-01-31 Mon> | ...
Tyler's user avatar
  • 22.3k
6 votes
Accepted

graphing R in org-babel

You're very close! Two changes: For the R code, you'll need a few more headers: #+BEGIN_SRC R :results output graphics :file test.png library("ggplot2") ggplot(iris, aes(x = Sepal.Width, y = ...
Gastove's user avatar
  • 1,551
6 votes
Accepted

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

Add a + to the key to append values to a property. For an instance, in your last example you should write: #+PROPERTY: header-args:R :exports both #+PROPERTY: header-args:R+ :session Note the + ...
Tobias's user avatar
  • 33.2k
5 votes

how to setup Knitr workflow in Emacs?

This is an all-in-one solution. It will create and display a PDF from an Rnw. Specifically it will: Save the Rnw buffer and knit it, Apply a given LaTeX engine to the resulting TeX file, Identify the ...
antonio's user avatar
  • 1,822
5 votes

Using constants inline

You need to set the :session header argument. This tells org that all R calculations will take place in the same session. For example: #+PROPERTY: header-args:R :session orgR I set my constant ...
Tyler's user avatar
  • 22.3k
4 votes

Using constants inline

I think the defined constant can be used in tables, and only there. #+CONSTANTS: t=10 | 1 | 10 | | 2 | 20 | #+TBLFM: $2=$1*$t However, you can add the header argument :session to make your second ...
theldoria's user avatar
  • 1,845
4 votes
Accepted

ESS: getting help on package

M-x ess-display-package-index, bound to C-c C-d i by default, does exactly this.
Tyler's user avatar
  • 22.3k
4 votes
Accepted

Draw pie chart from orgmode table

As mentioned in my comment, you need to pass the variable as a :var header on the #+begin_src line, not on the #+name: line. But you also need to specify that the results be output to a graphics file. ...
NickD's user avatar
  • 29.8k
4 votes
Accepted

How to add function call highlighting in ESS?

ess-R-font-lock-keywords is a user option that is mentioned in the ESS manual as: Font-lock patterns for ESS R programming mode. (There is a corresponding ess-S-font-lock-keywords for S buffers.) The ...
shir's user avatar
  • 51
3 votes

ESS R error: searching for program

It's no longer required to use Rterm.exe; you can just use R.exe directly. To configure the program name that emacs/ESS uses, set the variable in your .emacs like this: (setq inferior-ess-r-program "...
axiomatic's user avatar
3 votes

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

A standard feature of babel blocks is each block is executed in a new interpreter. Often this is good as changes in one block doesn't mess up others. I have two ideas for you... In this particular ...
Howard Abrams's user avatar
3 votes
Accepted

Run R code on selected object

Here's a quick and dirty approach. Depending on what you want there's lots of room for improvement. (defun head-at-point () (interactive) (let ((target (thing-at-point 'symbol))) (ess-send-...
Tyler's user avatar
  • 22.3k
3 votes

Any equivalent of R+ESS for python?

I managed to set up something close to my requirements above. Here it is, for people who may have my same needs. Let me stress that such requirements are very subjective, so the set-up below is not ...
pglpm's user avatar
  • 301
3 votes
Accepted

general function to concat token at point with function and send to *R*

I'll give you an hint: (defun apply-r-func-at-point (func) "Apply R FUNC at point, FUNC should be a string." (let ((sym (ess-symbol-at-point))) (if sym (ess-send-string (get-...
Elia's user avatar
  • 181
3 votes
Accepted

Creating scratch R files

You can create a buffer without an associated file. (defun ess-r-mode-scratch () "Create or switch to a scratch buffer in ess-r-mode" (interactive) (switch-to-buffer (get-buffer-create ...
matteol's user avatar
  • 2,018
2 votes

How to find what causes ESS to run very slow?

I know this is 5, almost 6, years late. The last response is from January of this year though. There's been a recent development that might solve the issue for people in the future. It turns out that ...
MentatOfDune's user avatar
2 votes

ESS plot directly to an Emacs buffer?

I just posted an answer to the old post you are referring to in your question. As I wrote there, this may not work for you since it would be quite a dramatic change in your overall computer workflow. ...
prosoitos's user avatar
  • 205
2 votes

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

In my emacs and ess, I just typed "<" then <<>>= @ comes out automatically.
Yifei Liu's user avatar
2 votes
Accepted

How Do you export only R code from Rnw file

In R, tangling is implemented via knitr::purl and utils::Stangle. ESS provides an interface to these commands. See the variable ess-swv-processor and the ess-swv-weave function (bound to M-n s in ...
rasmus's user avatar
  • 2,722
2 votes

How to get documentation link in ESS R?

If reading the documentation in your browser instead of directly within Emacs works for you, you can use the html help files instead of the text files by configuring your .Rprofile: Simply replace: #...
prosoitos's user avatar
  • 205
2 votes

ESS freezes on startup with ess-tracebug mode enabled

I had the same issue but now it should be fixed in the development version.
Luca Braglia's user avatar
2 votes
Accepted

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

This was a known bug and updating to latest ESS version solves the problem. See https://github.com/emacs-ess/ESS/issues/596.
Denis's user avatar
  • 93
2 votes

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

I believe the reason lies in org-babel-R-write-object-command (defconst org-babel-R-write-object-command "{ function(object,transfer.file) { object invisible( if ( ...
ebpa's user avatar
  • 7,479
2 votes

How to copy output from ess to the kill ring?

Maybe not as elegant as what you want, but there are functions for each step in your workflow: ess-switch-to-inferior-or-script-buffer, C-c C-z set-mark, C-<space> comint-previous-prompt, C-c C-...
Tyler's user avatar
  • 22.3k
2 votes
Accepted

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

Note that script-proc-buffer will always be new-buffer since that is an existing buffer when make-comint-in-buffer is called. To bind kill-process to the key sequence q make it somehow interactive ...
Tobias's user avatar
  • 33.2k
2 votes
Accepted

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

The reason I was having this problem is that I didn't have (require 'poly-R) in my init file. I only had (require 'poly-markdown). After adding (require 'poly-R), I can now press Enter within a chunk ...
riley.finn's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible