diff options
Diffstat (limited to 'R')
-rw-r--r-- | R/checkexperiment.R | 8 | ||||
-rw-r--r-- | R/drplot.R | 4 |
2 files changed, 3 insertions, 9 deletions
diff --git a/R/checkexperiment.R b/R/checkexperiment.R index fb83432..3078ca5 100644 --- a/R/checkexperiment.R +++ b/R/checkexperiment.R @@ -1,7 +1,5 @@ checkexperiment <- function(id,db="ecotox") { - op <- par(no.readonly = TRUE) - databases <- data.frame( responsetype=c("viability","activity","response"), testtype=c("celltype","enzyme","organism"), @@ -31,7 +29,8 @@ checkexperiment <- function(id,db="ecotox") odbcClose(channel) - par(ask=TRUE) + op <- par(ask=TRUE) + on.exit(par(op)) if (db %in% c("cytotox","enzymes")) { blinds <- subset(controldata,type=="blind") @@ -119,7 +118,4 @@ checkexperiment <- function(id,db="ecotox") legend("topright",substances, pch=1, col=1:length(substances), inset=0.05) title(main=paste(levels(expdata$experimentator), " - ",levels(expdata$type))) - - # Reset the graphics parameters to previous setting - par(op) } @@ -7,7 +7,6 @@ drplot <- function(drresults, data, pointsize = 12, colors = 1:8, devoff=T, lpos="topright") { - op <- par(no.readonly = TRUE) # Check if all data have the same unit unitlevels <- levels(as.factor(drresults$unit)) if (length(unitlevels) == 1) { @@ -88,6 +87,7 @@ drplot <- function(drresults, data, # If overlay plot is not requested, ask before showing multiple plots on the screen if (!postscript && !png && !pdf && length(dsubstances) > 1) { op <- par(ask=TRUE) + on.exit(par(op)) } } @@ -220,6 +220,4 @@ drplot <- function(drresults, data, dev.off() } } - # Reset the ask parameter to previous setting - par(op) } |