I want to use lintr to check R-files in emacs.
According to https://github.com/jimhester/lintr#emacs
lintr is fully integrated into flycheck when using ESS. See the installalation documentation for those packages for more information.
So per http://ess.r-project.org/index.php?Section=download I installed ess(version 17.11-2) via sudo apt-get install ess (I'm on ubuntu), and for flycheck I installed flycheck via MELPA.
Upon restart ESS is loaded automatically when opening an *.R file, for flycheck I type M-x flycheck (for simplicity, I didn't put the usepackage line in init.el)
On M-x flycheck-buffer nothing happened and M-x flycheck-verify-checker said that the library wasn't present, so I installed lintr as install.packages("lintr") in an R shell.
Now M-x flycheck-verify-checker r-lintr is all green:
r-lintr
- major mode: `ess-mode' supported
- may enable: yes
- predicate: t
- executable: Found at /usr/bin/R
- lintr library: present
Flycheck can use this syntax checker for this buffer.
With M-x flycheck-buffer you can see that it is working (there"s an * next to FlyC in the status bar) but ulimately nothing is found, while in an R shell lintr::lint("myfile.R") finds a lot!
Versions:
GNU Emacs 25.2.2
Ubuntu 18.04.3 LTS
Progress:
Philopolis' answer:
1) flycheck is now loaded automatically, but still errors are not found
2) the ess in Melpa is Incompatible because it depends on julia-mode-0.3 (not available) I'll look into that, Unable to install ESS package seems promising.
I've added Melpa stable and installed ess, but to no avail: While in other languages flycheck complains about trivial stuff like to many/view spaces, in R superfluous parenthesis go unnoticed.