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(writeOutput, add=T) # # subscript # source("C:/superscript.R") output <- data.frame(a=c(1,2,3), b=c(4,5,6)) For some reason, the file is not created. So it seems not to do the call. What do I do wrong? 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.