Laura,

Assuming you really want to do this via a large set of source files....

Each "job" could be distributed among several source files, so you don't 
necessarily need 320 copies of your entire program.  You may just want one 
program and sets of files that specify parameter values.

You can use cat() to write R code to an input file and source() to call 
the code.  For example:

>cat("rnorm(3,0,1)",file="test.r")
>x <- source("test.r",echo=TRUE)
> rnorm(3,0,1)
[1] 0.6611958 0.7270505 0.2691216

Glen

*************************************************
Glen A. Sargeant, Ph.D.
Research Wildlife Biologist/Statistician
Northern Prairie Wildlife Research Center
8711 37th Street SE
Jamestown, ND  58401

Phone: (701) 253-5528
E-mail:  glen_sargeant@usgs.gov
FAX:     (701) 253-5553
*************************************************



From:
Laura S <leslaura@gmail.com>
To:
r-sig-ecology@r-project.org
Date:
08/21/2010 12:51 PM
Subject:
[R-sig-eco] Making a series of similar, but modified .r files for 
simulation experiment - suggested method(s)?
Sent by:
r-sig-ecology-bounces@r-project.org



Dear all:

Any suggestions are much appreciated. I am looking for a way to make a
series of similar, but slightly modified, .r files.

My issue is automating making 320 .r files that change the for(i in 1:x) 
in
my base .r file (as well as other elements, e.g., the load(...),
setwd(...)). For smaller jobs running on a single computer with batch 
files,
I have been manually changing the for(i in 1:x) line, etc..

Why does this matter to me? I am planning on running a simulation 
experiment
on a linux cluster as a serial job. Although not elegant, it has been
suggested I make 320 .r files so qsub runs one .r file and then selects
other jobs. Thus, the manual route I am currently using would take a very
long time (given multiple runs of 320 .r files, given experimental
replication).

Thank you,
Laura

-- 
" Genius is the summed production of the many with the names of the few
attached for easy recall, unfairly so to other scientists"

- E. O. Wilson (The Diversity of Life)

                 [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



	[[alternative HTML version deleted]]

