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 <- function() {
        processTime <- proc.time()
        outputFilename <- paste("C:/myOutput_", processTime[3], ".csv", sep="")
        write.csv(output, file = outputFilename)
}



#
# subscript
#

source("C:/superscript.R")
output <- data.frame(a=c(1,2,3), b=c(4,5,6))
writeOutput()


I would like to

a) avoid the need to include the super script manually. Does R support
some kind of script inheritance?
b) Is it possible to call writeOutput() automatically when a script is exiting?

Best,
Ralf

______________________________________________
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 via email to