1) It would be better if you understood R "scripts" as functions. R,
possibly using either the proto or oo package, has at least 4
"inheritance" schemas that I know of. None will do what you want,
asaik.
2. ?on.exit will tell you what you did wrong below.
3. If I understand your query correctly,
Here the modified script with what I learned from Joshua:
#
# superscript
#
output <- NULL
writeOutput <- function() {
processTime <- proc.time()
outputFilename <- paste("C:/myOutput_", processTime[3], ".csv", sep="")
write.csv(output, file = outputFilename)
}
on.exit(wr
I think base:on.exit() will do the trick. Thank you :)
Ralf
On Wed, Oct 6, 2010 at 11:24 AM, Ralf B wrote:
>> If you are running these interactively, you could make your own
>> source() function. In that function you could define the super and
>> subscripts, and have it call writeOutput on.exit
> If you are running these interactively, you could make your own
> source() function. In that function you could define the super and
> subscripts, and have it call writeOutput on.exit(). I suspect you
> could get something like that to work even in batch mode by having R
> load the function by
On Wed, Oct 6, 2010 at 7:59 AM, Ralf B wrote:
> Hi all,
>
> in order to add certain standard functionality to a large set of
> scripts that I maintain, I developed a superscript that I manually
> include into every script at the beginning. Here an example of a very
> simplified super and subscript
Hi all,
in order to add certain standard functionality to a large set of
scripts that I maintain, I developed a superscript that I manually
include into every script at the beginning. Here an example of a very
simplified super and subscript.
#
# superscript
#
output <- NULL
writeOutput <- funct
6 matches
Mail list logo