Quantcast

Running script with double-click

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Running script with double-click

status-2
Hi,

I need to be able to run an R script by double-clicking the file name in
Windows. I've tried associating the .r extension with the different R
.exe's in /bin but none seems to work. Some open R then close right
away, and Rgui.exe gives the message ARGUMENT "/my/file.r" __ignored__
before opening a new, blank session.

I've tried Google and looking in the R for Windows FAQ but didn't see
anything.

Thanks.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running script with double-click

Peter Alspach-2
Tena koe Matt

I tend to create a .bat file with one line:

R\R-Current\bin\R CMD BATCH yourScript.R

where you replace R\R-Current\bin\R with the path to your R, and the
.bat file is in the same folder as yourScript.R.

There may be better ways, and doubtless someone will enlighten us both
if there are.

HTH ....

Peter Alspach

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Matt Asher
> Sent: Friday, 5 March 2010 12:43 p.m.
> To: [hidden email]
> Subject: [R] Running script with double-click
>
> Hi,
>
> I need to be able to run an R script by double-clicking the
> file name in Windows. I've tried associating the .r extension
> with the different R .exe's in /bin but none seems to work.
> Some open R then close right away, and Rgui.exe gives the
> message ARGUMENT "/my/file.r" __ignored__ before opening a
> new, blank session.
>
> I've tried Google and looking in the R for Windows FAQ but
> didn't see anything.
>
> Thanks.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running script with double-click

Steve Taylor
In reply to this post by status-2
You can create a right-mouse menu command to run an R program as follows (although the details may be different for different versions of Windows).
 
In Windows Explorer:
1. Tools / Folder Options / File Types
2. find the extension for R files and push Advanced
3. add a new action called "Run" with command as follows:
"C:\Program Files\R\R-2.10.1\bin\Rterm.exe" --quiet --no-save --no-restore -f "%1"
If/when you have a different version of R installed, you'll need to adjust the above command.
 
Steve

>>>

From: Matt Asher <[hidden email]>
To:<[hidden email]>
Date: 5/Mar/2010 12:45p
Subject: [R] Running script with double-click
Hi,

I need to be able to run an R script by double-clicking the file name in
Windows. I've tried associating the .r extension with the different R
.exe's in /bin but none seems to work. Some open R then close right
away, and Rgui.exe gives the message ARGUMENT "/my/file.r" __ignored__
before opening a new, blank session.

I've tried Google and looking in the R for Windows FAQ but didn't see
anything.

Thanks.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help 
PLEASE do read the posting guide http://www.R ( http://www.r/ )-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running script with double-click

status-2
Thanks Steve. This is working except for plots not showing up. I'll see
if I can fix that.

Do you know how to target the output to an R Console that will stay open
(Rgui would be best)?

Cheers,

Matt

Steve Taylor wrote:

> You can create a right-mouse menu command to run an R program as
> follows (although the details may be different for different versions
> of Windows).
>  
> In Windows Explorer:
> 1. Tools / Folder Options / File Types
> 2. find the extension for R files and push Advanced
> 3. add a new action called "Run" with command as follows:
> "C:\Program Files\R\R-2.10.1\bin\Rterm.exe" --quiet --no-save
> --no-restore -f "%1"
> If/when you have a different version of R installed, you'll need to
> adjust the above command.
>  
> Steve
>
>  
> *From: * Matt Asher <[hidden email]>
> *To:* <[hidden email]>
> *Date: * 5/Mar/2010 12:45p
> *Subject: * [R] Running script with double-click
>
> Hi,
>
> I need to be able to run an R script by double-clicking the file name in
> Windows. I've tried associating the .r extension with the different R
> .exe's in /bin but none seems to work. Some open R then close right
> away, and Rgui.exe gives the message ARGUMENT "/my/file.r" __ignored__
> before opening a new, blank session.
>
> I've tried Google and looking in the R for Windows FAQ but didn't see
> anything.
>
> Thanks.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R 
> <http://www.r/>-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running script with double-click

Gabor Grothendieck
In reply to this post by Steve Taylor
Note that if you use Rterm.bat in http://batchfiles.googlecode.com in
place of Rterm.exe then you won't have to adjust the Run action when
you upgrade R.  Rterm.bat is a single self contained Windows batch
file that you simply place on your Windows path.

On Thu, Mar 4, 2010 at 8:51 PM, Steve Taylor <[hidden email]> wrote:

> You can create a right-mouse menu command to run an R program as follows (although the details may be different for different versions of Windows).
>
> In Windows Explorer:
> 1. Tools / Folder Options / File Types
> 2. find the extension for R files and push Advanced
> 3. add a new action called "Run" with command as follows:
> "C:\Program Files\R\R-2.10.1\bin\Rterm.exe" --quiet --no-save --no-restore -f "%1"
> If/when you have a different version of R installed, you'll need to adjust the above command.
>
> Steve
>
>>>>
>
> From: Matt Asher <[hidden email]>
> To:<[hidden email]>
> Date: 5/Mar/2010 12:45p
> Subject: [R] Running script with double-click
> Hi,
>
> I need to be able to run an R script by double-clicking the file name in
> Windows. I've tried associating the .r extension with the different R
> .exe's in /bin but none seems to work. Some open R then close right
> away, and Rgui.exe gives the message ARGUMENT "/my/file.r" __ignored__
> before opening a new, blank session.
>
> I've tried Google and looking in the R for Windows FAQ but didn't see
> anything.
>
> Thanks.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R ( http://www.r/ )-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Loading...