[done] Integration / lancher for R

Request Features and Feature Changes

[done] Integration / lancher for R

Postby nabash » Mon Dec 15, 2008 7:32 am

Hi Cody,
First of all great work, I find myself more and more using Editra.
Under windows and especially under Linux there is no good editor R integration (well Tinn-R is not bad but not very good and available only for windows).
It would be great to edit R code with Editra and with a single click to run it in R console!
THX
nabash
Limited User
 
Posts: 3
Joined: Mon Dec 15, 2008 7:25 am

Re: Integration / lancher for R

Postby cody » Mon Dec 15, 2008 12:51 pm

Sure this can be easily added.

1) What is the name of the executable usually used to run R


2) Do you have some example of error output (i.e exception tracebacks), if so I can also add functionality for navigating to errors from the output window.


Cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Integration / lancher for R

Postby nabash » Tue Dec 16, 2008 2:17 pm

1) There are several possibilities for the executables in windows:
-- R.exe and Rterm.exe are a terminal like interaction with the system.
-- Rgui.exe is very simple UI for R.
-- Rscript.exe, Ithink that it receives a R script file and runs it in the background.
My guess is that the R.exe and Rterm.exe are the candidates.

2) I'm not sure what you mean, but I will try...
The error message is in bold, normal text is the code.
Here the header attributes is incorrect
> stam<-read.table("NoFileLikeThis.csv", headers=TRUE, sep=",")
Error in read.table("NoFileLikeThis.csv", headers = TRUE, sep = ",") :
unused argument(s) (headers = TRUE)



Here the file does not exist
> stam<-read.table("NoFileLikeThis.csv", header=TRUE, sep=",")
Error in file(file, "r") : cannot open the connection
In addition: Warning message:
In file(file, "r") :
cannot open file 'NoFileLikeThis.csv': No such file or directory


If you need more information please let me know, I would like to help, test and contribute if I can.
nabash
Limited User
 
Posts: 3
Joined: Mon Dec 15, 2008 7:25 am

Re: Integration / lancher for R

Postby cody » Tue Dec 16, 2008 2:44 pm

Thanks,

Those error messages look about right. Is there something different that happens why you say run a file and there is an error in it. Like traceback with an error message, filename, line number ect...? That way I can set the launch window to recognize that pattern and provide links to jump straight to the error.


Cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Integration / lancher for R

Postby nabash » Tue Dec 16, 2008 3:20 pm

The R is some sort of an interpreter for statistical language, but very limited. It provides warnings and errors only. If an error occurred the program program stops. It executes the commands sequentially with no line numbers.
The general (simple) usage scenario will be something like:
Write R code in Editra
Highlight a line / part of the code /all the code
Send it to R and pray
View results textual results in R console or a graphic window that R opened for plotting.

This is the way to run a script in the background.
Rscript.exe %p%n%e" in command line (%p for path; %n for file name; %e for file extension.
When there is an error in the script there is a very laconic error message with no traceback like line number.
Noam
nabash
Limited User
 
Posts: 3
Joined: Mon Dec 15, 2008 7:25 am

Re: Integration / lancher for R

Postby cody » Tue Dec 16, 2008 3:45 pm

Ok thats even easier then since I don't need to do anything for it ;)

Done. Added support to next version of Launch plugin for running R scripts. Will likely require minor configuration on first use.

This also reminds me that I should try to fix the R Lexer as it is way too slow.

Launch currently only supports running the whole file that is open in the buffer. However adding support to run selection is a good idea. If you want this added please fill out a feature request at editra.googlecode.com/

Thanks,

Cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron