[rkward-users] Error when trying to load an .R file in clicking on it

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Wed Mar 7 15:37:32 UTC 2012


Hi,

sorry for the long delay.

On Tuesday 28 February 2012, Francois Maurice wrote:
> I'd like to be able to load a script file directly when I clic on it but
> the following error message appears : 
> Error loading workspace - RKWard
> There has been an error opening file
>  'J:/dossiers/Francois/Cours/COURS.E10/SOL6021/Programmation/R/Analyse.R':
>  
> Is there a way to do that ?

RKWard tries to open a file passed on the command line as a workspace, not as a 
script file. This may be improved in the future, but currently that's the way 
it is. It is possible to work around this, although on Windows that's quite 
cumbersome:

1. Create a .bat file with the following content:

REM opens command line argument as a script file in RKWard
SET file=%1
SET file=%file:\=/%
C:\RKWard\KDE\bin\rkward.bat --evaluate rk.edit.files('%file%')

(NOTE: Replace c:\RKWard\KDE\bin\rkward.bat with the correct path to 
rkward.bat on your system).

2. Change the file type association of .R files from rkward to the .bat file you 
created.

Now, clicking a .R file should start an RKWard session, and run the command
  rk.edit.files('FILENAME')
in it, automatically. Note that each .R file will open in a separate rkward 
session.

I hope that helps a bit.

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-users/attachments/20120307/0bda25dd/attachment.sig>


More information about the Rkward-users mailing list