|
From: <gg...@us...> - 2008-09-16 07:45:38
|
Revision: 86
http://bugs-r.svn.sourceforge.net/bugs-r/?rev=86&view=rev
Author: ggorjan
Date: 2008-09-16 07:45:46 +0000 (Tue, 16 Sep 2008)
Log Message:
-----------
temporary copy of model.file to a working.directory if it does not have txt extension; removing script.txt at the end of run if clearWD=TRUE
Modified Paths:
--------------
trunk/R2WinBUGS/R/bugs.R
trunk/R2WinBUGS/inst/NEWS
Modified: trunk/R2WinBUGS/R/bugs.R
===================================================================
--- trunk/R2WinBUGS/R/bugs.R 2008-02-01 09:42:28 UTC (rev 85)
+++ trunk/R2WinBUGS/R/bugs.R 2008-09-16 07:45:46 UTC (rev 86)
@@ -82,11 +82,11 @@
bugs.inits.files <- bugs.inits(inits, n.chains, digits)
}
-
if(DIC) parameters.to.save <- c(parameters.to.save, "deviance")
## Model files with extension ".bug" need to be renamed to ".txt"
- if(length(grep("[.]bug$", model.file))) {
- new.model.file <- sub("[.]bug$", ".txt", model.file)
+ if(!length(grep("\\.txt$", tolower(model.file)))) {
+ new.model.file <- paste(basename(model.file), ".txt", sep="")
+ if(!is.null(working.directory)) new.model.file <- file.path(working.directory, new.model.file)
file.copy(model.file, new.model.file, overwrite=TRUE)
on.exit(try(file.remove(new.model.file)), add=TRUE)
} else {
@@ -112,7 +112,7 @@
model.file=model.file, program=program)
if(clearWD) {
file.remove(c(bugs.data.file, "log.odc", "log.txt", "codaIndex.txt",
- bugs.inits.files,
+ bugs.inits.files, "script.txt",
paste("coda", 1:n.chains, ".txt", sep="")))
}
class(sims) <- "bugs"
Modified: trunk/R2WinBUGS/inst/NEWS
===================================================================
--- trunk/R2WinBUGS/inst/NEWS 2008-02-01 09:42:28 UTC (rev 85)
+++ trunk/R2WinBUGS/inst/NEWS 2008-09-16 07:45:46 UTC (rev 86)
@@ -1,6 +1,13 @@
Changes to R2WinBUGS:
=====================
+Update 2.1-8?
+- File script.txt is also removed when clearWD=TRUE.
+
+- If model.file does not have a "txt" extension, then it is temporarily
+ copied to a file with "txt" extension in the working directory and
+ removed at the end of WinBUGS run.
+
Update 2.1-7
- this file is now available as NEWS file in top folder of installed package
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|