run r scripts (tinn) via command

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

run r scripts (tinn) via command

thoeb
Hello, I am working on a project consisting of several r-scripts written in the tinn editor. Is it possible to create a superior r script containing commands to run the sub-scripts one by one?
Reply | Threaded
Open this post in threaded view
|

Re: run r scripts (tinn) via command

Ben Bolker
thoeb <t.hoebinger <at> gmail.com> writes:

> Is it possible to create a superior r script containing
> commands to run the sub-scripts one by one?


  ?source

______________________________________________
[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
|

Re: run r scripts (tinn) via command

thoeb
The scripts are written with the TINN editor (***.r) and are organised within a project. I want to create another script that opens and runs the other scripts so I just have to activate that superior script to run all the other scripsts too.

Ben Bolker wrote
thoeb <t.hoebinger <at> gmail.com> writes:

> Is it possible to create a superior r script containing
> commands to run the sub-scripts one by one?


  ?source

______________________________________________
R-help@r-project.org 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
|

Re: run r scripts (tinn) via command

jholtman
You just create the "superior" script as a set of 'source' statements
reading in the files that you want to execute in order.

On Thu, Mar 19, 2009 at 4:13 AM, thoeb <[hidden email]> wrote:

>
> The scripts are written with the TINN editor (***.r) and are organised within
> a project. I want to create another script that opens and runs the other
> scripts so I just have to activate that superior script to run all the other
> scripsts too.
>
>
> Ben Bolker wrote:
>>
>> thoeb <t.hoebinger <at> gmail.com> writes:
>>
>>> Is it possible to create a superior r script containing
>>> commands to run the sub-scripts one by one?
>>
>>
>>   ?source
>>
>> ______________________________________________
>> [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.
>>
>>
>
>
> -----
> Tamara Hoebinger
> University of Vienna
> --
> View this message in context: http://www.nabble.com/run-r-scripts-%28tinn%29-via-command-tp22580362p22595077.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [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.
>



--
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?

______________________________________________
[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
|

Re: run r scripts (tinn) via command

thoeb
Thank you! Works perfectly well!

jholtman wrote
You just create the "superior" script as a set of 'source' statements
reading in the files that you want to execute in order.

On Thu, Mar 19, 2009 at 4:13 AM, thoeb <t.hoebinger@gmail.com> wrote:
>
> The scripts are written with the TINN editor (***.r) and are organised within
> a project. I want to create another script that opens and runs the other
> scripts so I just have to activate that superior script to run all the other
> scripsts too.
>
>
> Ben Bolker wrote:
>>
>> thoeb <t.hoebinger <at> gmail.com> writes:
>>
>>> Is it possible to create a superior r script containing
>>> commands to run the sub-scripts one by one?
>>
>>
>>   ?source
>>
>> ______________________________________________
>> R-help@r-project.org 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.
>>
>>
>
>
> -----
> Tamara Hoebinger
> University of Vienna
> --
> View this message in context: http://www.nabble.com/run-r-scripts-%28tinn%29-via-command-tp22580362p22595077.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org 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.
>



--
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?

______________________________________________
R-help@r-project.org 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
|

Re: run r scripts (tinn) via command

camilo_abboud
In reply to this post by thoeb
¿How to run several commands with one script?

Functions needed: SOURCE (script) + logical functions(if, while, for) + scan(parameter A)

Im not going to put an example, but the thing is:

1) run the main script, which contains another SOURCE-funtion wich points to an other script.      source(source(2nd script))

2) If you want to be asked to run a secundary script, use function SCAN().

3) If you want to run secundary code IF something...use the If funtion and so one. if(TRUE){source()}

4) The scan function also helps to stop code at a certain point, not very elegant but helps.


Hope this helps after 2009.