Auto-completion for Stat ET / Eclipse? - r

after using sciviews-K for a while, I am about to give the R Eclipse combo another chanced. I updated to Helios on my Mac OS X Snow Leopard. So far everything that used to make trouble with Eclipse works, but somehow I miss the auto-completion of code. Or at least the standard suggestion of paramaters when you use R functions. This is even possible in the standard R GUI.
How can I use some of these enhancements with StatET Eclipse?
Thx in advance for not telling me to use Emacs / ESS !

Looks like you can't have an answer shorter than 15 characters, so here is some elaborate text to pass this silly check. Try pressing Ctrl+Space.

Related

Export output and command lines in R [duplicate]

Is there an easy way to have R record all input and output from your R session to disk while you are working with R interactively?
In R.app on Mac OS X I can do a File->Save..., but it isn't much help in recovering the commands I had entered when R crashes.
I have tried using sink(...,split=T), but it doesn't seem to do exactly what I am looking for.
Many of us use ESS / Emacs for this very reason. Saving old sessions with extension '.Rt' even gives you mode-specific commands for re-running parts of your session.
Greg Snow wrote recently on the R-help list (a very valuable resource, SO R people!):
"You may also want to look at ?TeachingDemos::txtStart as an alternative to sink, one advantage is that the commands as well as the output can be included. With a little more work you can also include graphical output into a transcript file."
r-help
Check out the savehistory() command
I'm not sure yet how to answer an answer, but there is an updated version of Ranke's vim r-plugin called r-plugin2 available here. It seems more user-friendly and robust than the original.
Emacs is good, but for those of us with a vi preference there's the vim-r plugin at:
http://www.uft.uni-bremen.de/chemie/ranke/index.php?page=vim_R_linux
It works brilliantly and has a tiny memory footprint.

Syntax Highlighting for R in Macvim

I use R and I find some of the embedded editor's characteristics annoying. Typically, it would be convenient to have the possibility to add tabs or even bette to do splits like you can do it with vim.
I have a Mac running Mavericks and I use Macvim. I want to use vim as my R editor, without using it as an IDE.
However, the syntax highlighting is not convincing. The functions are not recognized for instance.
I installed the Vim-R-plugin (I followed these instructions). However, I found no change in my syntax highlighting.
Do you have any suggestions?
R-Studio is a development environment for R. It is very light and powerful and it offers some embedded themes to highlight code.
You can use it as editor only...

%>% key binding / keyboard shortcut in Rstudio

I've been experimenting quite a bit with the increasingly popular %>% operator from the magrittr package.
I've used it enough that I've set a keyboard shortcut to save me typing:
shift+command+. instead of space, shift+5, shift+., shift+5, space.
This is great in SublimeTetxt2 but Rstudio does not allow services it does not work if I'm working within Rstudio projects.
So my question is:
Can you define text-inserting key-bindings or shortcuts within Rstudio?
This would be exactly synonymous with the alt+- binding for the assignment <- operator that is oxygen to the otter.
If someone could point me to where the shortcuts are coded in the github repo so I could "hack" my own, I suppose this would be a useful start.
https://github.com/rstudio/rstudio
Just noticed that RStudio v0.98.1079 has shift+command+M mapped for the %>% operator. You can check out the other keyboard shortcuts within RStudio by clicking at the Help tab or by entering alt+shift+K.
I think the answer to your question is "Not currently, but it's on RStudio's to-do list" (see: this and this).
If you want to hack it yourself, it looks like this is where you'd do it (GitHub: rstudio / src / gwt / src / org / rstudio / core / rebind / command / ShortcutsEmitter.java).
Also, it looks like shortcuts are managed here (GitHub: rstudio / src / gwt / src / org / rstudio / core / client / command).
For stuff like that you can use autohotkey. it is an external windows program but can do pretty much anything including hotkeys that type stuff and acronyms that are replaced by stuff you want
R studio Preview (v0.99.671) now supports keybuindings customization. It also has a bunch of other nice improvements, give it a try:
https://www.rstudio.com/products/rstudio/download/preview/
For people now, the best way to do something like this in RStudio if it's not already built in is to add a "snippet":
https://appsilon.com/rstudio-shortcuts-and-tips/#custom-snippets
It's in your global options and can be used to save pieces of code you often repeat to quickly insert it.

Changing Cntrl + R shortcut for Running scripts in R Windows GUI

Is is possible to change the "Control + R" shortcut for sending scripts from the R text editor in the Windows GUI to the R console? I'd like to change it to "Control + Enter" to be more like the shortcut on my Mac. I do all my normal work on a Mac but have to use R on a PC to interface with some PC-only computational software.
Additional tidbits:
I'd rather not run an IDE on the PC if I don't have to, though perhaps this is the solution.
I use Rstudio on my Mac, but Rstudio does not get along with the PC software I'm running
The short answer is:
"No, there are no [built-in] ways to alter the menu shortcuts in the R Console"
I'm however gathering here -community wiki style- some of suggestions posted as remarks to this questions.
One approach may be to download the R source, hack it (see circa line 625 of src/gnuwin32/editor.c: ), and build the R binary anew (see the R for Windows FAQ for the tools you need to build from source). This seems to be a rather radical approach for the mere convenience of using an alternate keystroke sequence...
A similar approach may be to create an automatic patcher program which would patch the R executable, by locating the byte patterns surrounding the compiled logic of editor.c mentioned above and replacing it with a byte sequence for the desired keystroke. This solution may be sensitive to changes in the binaries, but also avoids the build process altogether...
An easier way to achieve this is probably by using an external text editor. Most modern editors have macros or configs that can be used, for example, to execute a source command in R for the selected text.
Customizing keyboard shortcuts is made available in Rstudio 0.99.644.
See https://support.rstudio.com/hc/en-us/articles/206382178-Customizing-Keyboard-Shortcuts for more information.

maintaining an input / output log in R

Is there an easy way to have R record all input and output from your R session to disk while you are working with R interactively?
In R.app on Mac OS X I can do a File->Save..., but it isn't much help in recovering the commands I had entered when R crashes.
I have tried using sink(...,split=T), but it doesn't seem to do exactly what I am looking for.
Many of us use ESS / Emacs for this very reason. Saving old sessions with extension '.Rt' even gives you mode-specific commands for re-running parts of your session.
Greg Snow wrote recently on the R-help list (a very valuable resource, SO R people!):
"You may also want to look at ?TeachingDemos::txtStart as an alternative to sink, one advantage is that the commands as well as the output can be included. With a little more work you can also include graphical output into a transcript file."
r-help
Check out the savehistory() command
I'm not sure yet how to answer an answer, but there is an updated version of Ranke's vim r-plugin called r-plugin2 available here. It seems more user-friendly and robust than the original.
Emacs is good, but for those of us with a vi preference there's the vim-r plugin at:
http://www.uft.uni-bremen.de/chemie/ranke/index.php?page=vim_R_linux
It works brilliantly and has a tiny memory footprint.

Resources