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
35 votes
3 answers
4k 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 ...
Dan's user avatar
  • 33k
21 votes
2 answers
5k 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+...
drobnbobn's user avatar
  • 585
10 votes
3 answers
1k 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=...
Shambho's user avatar
  • 467
10 votes
2 answers
1k 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 ...
Kristóf Marussy's user avatar
8 votes
1 answer
6k 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 <...
Shambho's user avatar
  • 467
8 votes
1 answer
584 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 ...
Philopolis's user avatar
  • 1,134
7 votes
1 answer
534 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 ...
Liudvikas Akelis's user avatar
7 votes
1 answer
5k 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 ...
n1k31t4's user avatar
  • 689
7 votes
1 answer
717 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 ...
doctorate's user avatar
  • 1,829
6 votes
3 answers
678 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 ...
Gilly's user avatar
  • 211
6 votes
1 answer
332 views

Using org-table data for R block

I'd like to be able to plot in an orgbabel chunk these data I have in a org-table: #+NAME:amount | date | amount |------------------+--------| | <2022-01-30 Sun> | 55.1 | | <...
Emmanuel Goldstein's user avatar
6 votes
1 answer
489 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 ...
Brandon Sherman's user avatar
5 votes
2 answers
827 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 ...
SlowLearner's user avatar
5 votes
1 answer
566 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 (...
Dan's user avatar
  • 33k
5 votes
1 answer
730 views

Any equivalent of R+ESS for python?

I do a lot of R coding on Emacs – on Windows – using the wonderful ESS package. What I particularly like is that I can: start an R session, and then send lines or regions of the script I'm working on ...
pglpm's user avatar
  • 301
5 votes
1 answer
226 views

How to implement the native |> pipe in ESS mode

Using the code provided here I can use the magrittr package pipe %>%. I want to switch to the new native R pipe |>, but if I just substitute the old pipe with the new one the code is not ...
Claudio's user avatar
  • 171
5 votes
1 answer
579 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: --------...
Philopolis's user avatar
  • 1,134
5 votes
2 answers
261 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 ...
mhb's user avatar
  • 243
4 votes
1 answer
3k 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: ...
בנימן הגלילי's user avatar
4 votes
1 answer
2k 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 :...
mhb's user avatar
  • 243
4 votes
1 answer
195 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?
wdkrnls's user avatar
  • 3,707
4 votes
1 answer
119 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?
laxxy's user avatar
  • 335
4 votes
1 answer
120 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 ...
asb's user avatar
  • 245
4 votes
1 answer
110 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 ...
Dan's user avatar
  • 33k
4 votes
3 answers
866 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). ...
Ken Williams's user avatar
4 votes
0 answers
135 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) ...
Adam's user avatar
  • 1,897
3 votes
1 answer
138 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 ...
John Doe's user avatar
3 votes
1 answer
505 views

Convert orgmode to Rmd

As the title says, I have an orgmode file I have been using with ess and exporting to TeX which has been going very well. However, I need to now export to html for reasons out of my control, and was ...
HaoZeke's user avatar
  • 145
3 votes
1 answer
303 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?
Heisenberg's user avatar
3 votes
0 answers
748 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 ...
jerome's user avatar
  • 213
3 votes
0 answers
579 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 ...
r2evans's user avatar
  • 275
2 votes
2 answers
67 views

Creating scratch R files

Often I want to create a temporary R file and don't want to save the file or name the file. Is there a way to achieve this outside of using C-x C-f and naming a file? For example, in VSCode or Rstudio ...
cdd's user avatar
  • 217
2 votes
2 answers
2k 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 * ...
בנימן הגלילי's user avatar
2 votes
2 answers
353 views

Evaluate Single Python Code Blocks in a Quarto File like in R Studio or Jupyter Lab

Quarto is a literate programming framework. It allows you to combine in a single file code (in various programming languages) and text (in markdown).* When a Quarto document is rendered, the output ...
henning's user avatar
  • 112
2 votes
1 answer
52 views

exporting table from R

I'm trying to export a table from an R code block and have read Results of Evaluation (The Org Manual) which states that tables can be output with header options of :exports results :results value ...
slackline's user avatar
  • 345
2 votes
1 answer
211 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 ...
riley.finn's user avatar
2 votes
1 answer
142 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 ...
Denis's user avatar
  • 93
2 votes
1 answer
243 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 ...
doctorate's user avatar
  • 1,829
2 votes
1 answer
262 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 ...
Nicolas Scotto Di Perto's user avatar
2 votes
1 answer
21 views

ESS: are there "special" breakpoints for pipes?

The ESS Manual announces a new feature as of v16.04: ESS[R]: New specialized breakpoints for debugging magrittr pipes However there is no other mention of these "specialized" breakpoints ...
jerome's user avatar
  • 213
2 votes
1 answer
121 views

emacs ess apply function to token under point

I've finally committed to moving over to both emacs and ess -- and i'm having a bit of trouble getting (the famously customisable) combination to work as i'd like. Say that i have a file that ...
ricardo's user avatar
  • 147
2 votes
1 answer
201 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 ...
Arktik's user avatar
  • 972
2 votes
2 answers
349 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) ...
Jason Morgan's user avatar
2 votes
0 answers
588 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" ...
jerome's user avatar
  • 213
2 votes
0 answers
176 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 ...
Quigi's user avatar
  • 21
2 votes
0 answers
38 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 ...
Huw's user avatar
  • 21
2 votes
0 answers
122 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 ...
Alex's user avatar
  • 1,038
1 vote
1 answer
288 views

How to add function call highlighting in ESS?

I currently have some syntax highlighting in my ESS code (e.g., for brackets, =, and strings). I would like to add highlighting of function calls, like RStudio's "Highlight R function calls" ...
shir's user avatar
  • 51
1 vote
1 answer
54 views

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

I'm moving my R setup over to emacs and ess -- and am struggling with the emacs / LISP customisation process. In an answer to another question, I learnt how to create a function that concats a ...
ricardo's user avatar
  • 147
1 vote
2 answers
3k 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 ...
Forge's user avatar
  • 285