Hot answers tagged

19

The problem you're referring to is probably that when you upgrade a package from within an Emacs session where that package is already in use, the old version of the package will sometimes interfere during compilation of the new version, leading to miscompiled files. There is a tentative fix for that in Emacs-25, but AFAIK the problem is still present in 24....


12

UPDATE As of ESS 19.04, the ess-noweb and ess-swv libraries are obsolete: Libraries for literate data analysis are obsolete and not loaded by default. This includes 'ess-noweb', 'ess-swv', and related functionality like 'Rnw-mode'. Users are encouraged to switch to one of several other packages that deal with these modes. For example, ...


9

With the notable exception of ProofGeneral, I'm not aware of any major Emacs package that's not available in some ELPA archive. Specifically, ESS is on MELPA since three years. And PG is a story on its own, and definitely not representative for the whole Emacs ecosystem. ELPA surely has its flaws, but for the vast majority of packages it works just fine,...


7

thanks to mutbuerger for the helpful comments. Currently, I use this for this operator to work with ESS only. (defun then_R_operator () "R - %>% operator or 'then' pipe operator" (interactive) (just-one-space 1) (insert "%>%") (reindent-then-newline-and-indent)) (define-key ess-mode-map (kbd "C-%") 'then_R_operator) (define-key inferior-ess-...


7

Set ess-arg-function-offset to nil: (setf ess-arg-function-offset nil) For me this indents your examples the way that you want them to be. Read the documentation of the variable to find out why (and note that c is a function call). Simply setting it once in an init file does not work. A simple way for it to register is to set it in ess-mode-hook: (add-...


6

I like orgstruct-mode. In the following file you can collapse headings with Tab or S-Tab, much like in org-mode. Note that the eval part below collapsed the file to out-most level when opening the file. ##* sec1 x <- rnorm(10) ##** sec11 y <- x<0 ##* sec 2 z <- x + y ## Local Variables: ## outline-regexp: "##*\\*+\\|\\`" ## orgstruct-heading-...


6

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 of the Org file is exported to, say, HTML or LaTeX formats. Note that :exports affects only ‘src’ code blocks and not inline code. code The default....


5

Not completly an answer to the question, but when one use R in org-mode's babel: * My example #+name: simple-org-example #+begin_src R :session *my-R* :dir "." :results output graphics :file example.svg :width 18 :height 9 plot(cyl~mpg,data=mtcars) #+end_src Doing a C-c C-c on this in org-mode will create a *my-R* buffer with an interacting ESS buffer, ...


5

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 BibTeX engine executable (e.g. biber, bibtex8), Run the BibTeX engine on the TeX file if the bib file is newer than TeX file, Run LaTeX again, 6 Open ...


5

set-default-font by default sets the font for current frame only from the documentation C-hfset-default-fontRET (emphasis mine) (set-default-font FONT &optional KEEP-SIZE FRAMES) This function is obsolete since 23.1; use `set-frame-font' instead. Set the default font to FONT. When called interactively, prompt for the name of a font, and ...


5

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 = Sepal.Length, color = Species)) + geom_point() #+END_SRC (Note that the headers change slightly depending on whether you want to use base R, as in your example, ...


5

I ran into a similar issue, and wrote a stand-alone function to get around the weird interactions between yasnippet and polymode. The following function mimics the behaviour of the snippet you tried, prompting first for the header info, which gets inserted at your $1, and then dropping you in the chunck body (your $0): (defun tws-insert-r-chunk (header) ...


5

The julia-mode package is in MELPA, but not in MELPA Stable, so you have to add another repository. (require 'package) (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/")) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) (package-initialize) If you prefer to use packages ...


5

You'll need to write your own function for doing this. You'll want to read up on the functions get-buffer-process and signal-process to learn about how to send the right signal to the ESS process. Here is an example: An interactive function that sends a SIGINT to a buffer of your choosing. You can modify this function to target whatever ESS buffer you ...


4

See here for a hint to the solution. From the changelist for 12.09-1: ESS[R] Auto-completion: new variable ess-ac-R-argument-suffix to customize the insertion of trailing "=". Defaults to “ = “. And from the documentation for the variable ess-ac-R-argument-suffix: ess-ac-R-argument-suffix is a variable defined in 'ess-r-completion.el'. Its value ...


4

C-c C-s is bound to ess-switch-process. You can also start a new process this way.


4

This behavior is controlled by comint-scroll-to-bottom-on-output. It's nil by default. You probably configured it to a different value accidentally.


4

The immediate cause of this delay is a timeout withing the TRAMP package, that is a dependency of ESS. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810640 The hang occurs when Emacs spawns ssh processes when initialising the variable `tramp-ssh-controlmaster-options'. If your ISP's DNS server likes to hijack failed lookups to redirect the user to a ...


4

M-x ess-display-package-index, bound to C-c C-d i by default, does exactly this.


4

I was missing ':ensure t . Now the ess package gets automatically installed at first use. For more information on how to load packages from ELPA with package.el and use-package see: https://github.com/jwiegley/use-package (use-package ess :ensure t :init (require 'ess-site))


4

I have this in my config file: ;; smart assign (setq ess-smart-S-assign-key ";") ;if ";" needed, press ";" key twice (ess-toggle-S-assign nil) (ess-toggle-underscore nil) ;leave underscore key alone! With the later versions of ESS the following is sufficient: ;; Must be specified before loading ESS. (setq ess-smart-S-assign-key ";") ;if ";" needed, ...


4

If your ~/dotfiles/rundo.sh accepts stdin as input, like many other commands such as grep/wc/bash/python, to run a command with the region as stdin, simply run M-| ~/dotfiles/rundo.sh (M-| runs shell-command-on-region). If the command doesn't support stdin, the following should do what you described (defun rundo (beg end) "Wrapper of ~/dotfiles/rundo.sh."...


3

inferior-r-args is a customization variable, so you can edit it via M-x customize-variable inferior-r-args. ESS is a fairly complex package, and figuring out the timing for modifying variables can be a bit tricky - easier to use the customize facility when possible!


3

I have been struggling to do the same. I found a different route that allowed me to do basically the same thing. You can open a shell buffer by M-x shell and from there connect to the login node, and then connect to the interactive session by qsub -I. Once you're in the interactive session, start an R session by typing the command R. There, you can do M-x ...


3

It sounds like you should extend tramp-methods, adding a new method which is similar to the sudo method but uses qsub -I instead. You would then be able to use a multi-hop tramp path to first connect to the head node and then to connect to a compute node. Try this: (add-to-list 'tramp-methods '("qsub" (tramp-login-program "qsub") (tramp-...


3

After some trials on Windows machine, I found this workflow works very well: Installation for Windows users Step 1 Put this in your init.el or .emacs.el file - after ESS code: (require 'poly-R) (require 'poly-markdown) (add-to-list 'auto-mode-alist '("\\.Rnw" . poly-noweb+r-mode)) ;;; MARKDOWN ; (add-to-list 'auto-mode-alist '("\\.md" . poly-markdown-mode)...


3

The function you are looking for is ess-eval-buffer-from-beg-to-here (bound to C-c <C-up> by default). I found this using M-x apropos "ess eval".


3

The issue is mostly caused by autoloads. In julia-mode.el you can see that (add-to-list 'auto-mode-alist '("\\.jl\\'" . julia-mode)) is marked as to be autoloaded. If you were to look at ~/.emacs.d/elpa/julia-mode-${version}/julia-mode-autoloads.el (which is automatically generated from julia-mode.el when you initially install the package), you would indeed ...


3

The error is simple: the polymode package does not define any polymode-mode-map (nor polymode-mode for that matter). Instead it defines polymode-minor-mode and corresponding polymode-minor-mode-map.


3

You can do M-x ess-interrupt.


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