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....
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
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 undesirable, especially if commands take long to finish. Users who want input to be displayed and Emacs not to be blocked can set ess-eval-visibly to 'nowait. This ...
You need to use the :exports both header argument. By default, org only exports R code, not the results. From the org manual:
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....
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 ...
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"
(define-key ess-mode-map (kbd "C-%") 'then_R_operator)
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:
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
ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length, color = Species)) +
(Note that the headers change slightly depending on whether you want to use base R, as in your example, ...
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.
x <- rnorm(10)
y <- x<0
##* sec 2
z <- x + y
## Local Variables:
## outline-regexp: "##*\\*+\\|\\`"
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)
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
:init (require 'ess-site))
The julia-mode package is in MELPA, but not in MELPA Stable, so you have to add another repository.
'("melpa-stable" . "https://stable.melpa.org/packages/"))
'("melpa" . "http://melpa.org/packages/"))
If you prefer to use packages ...
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.
Not completly an answer to the question, but when one use R in org-mode's babel:
* My example
#+begin_src R :session *my-R* :dir "." :results output graphics :file example.svg :width 18 :height 9
Doing a C-c C-c on this in org-mode will create a *my-R* buffer with an interacting ESS buffer, ...
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 ...
I have this in my config file:
;; smart assign
(setq ess-smart-S-assign-key ";") ;if ";" needed, press ";" key twice
(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, ...
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."...
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 ...
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 ...
The immediate cause of this delay is a timeout withing the TRAMP package, that is a dependency of ESS.
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 ...
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 ...
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!
After some trials on Windows machine, I found this workflow works very well:
Installation for Windows users
Put this in your init.el or .emacs.el file - after ESS code:
(add-to-list 'auto-mode-alist '("\\.Rnw" . poly-noweb+r-mode))
; (add-to-list 'auto-mode-alist '("\\.md" . poly-markdown-mode)...
You need to add poly-noweb+r-mode to auto-mode-alist for Rnw files. You also need to watch for conflicts with ESS. ESS adds its own mode to auto-mode-alist for Rnw files, so you have to wait until after this happens to make sure you over-ride the ESS settings. This is what I have in my .emacs:
(eval-after-load 'ess-site ...