0

I would like to submit the current selection to R instead of the entire file. Currently I have this in my r.properties (It submits the entire file):

command.go..R="C:\Program Files\R\R-2.15.2\bin\x64\Rscript.exe" --vanilla "$(FileNameExt)" command.go.subsystem..R=0

How can I submit only what I have currently selected in Scite (on Windows)? http://www.scintilla.org/SciTEDoc.html

user1134616
  • 596
  • 6
  • 14

1 Answers1

0

You can use command.input.number.filepattern, which is explained in documentation you linked. For example:

command.name.10.$(file.patterns.r)=Pipe selection to R
command.mode.10.$(file.patterns.r)=subsystem:0,savebefore:no
command.10.$(file.patterns.r)="C:\Program Files\R\R-2.15.2\bin\x64\Rscript.exe"
command.input.10.$(file.patterns.r)=$(CurrentSelection)

It will pipe the data from current selection to Rscript.exe. I don't use R, so I don't know if your Rscript.exe tool, accepts input to be piped like that, but you probably know that already.

theta
  • 24,593
  • 37
  • 119
  • 159
  • It works if I replace Rscript.exe by Rterm.exe and --save --quiet as options to it. It then stores the environment and loads it everytime a new line is submitted. This has two big disadvantages: (1) it is very inefficient, (2) loaded packages will be unloaded (i.e., I have to add a load() before every line of code and submit it together. Does anybody have a better approach? – user1134616 Feb 02 '13 at 19:35