aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorranke <ranke@d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc>2007-11-23 16:19:08 +0000
committerranke <ranke@d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc>2007-11-23 16:19:08 +0000
commit1066c87b174f2b3df19e54adee1ee435021441c9 (patch)
tree26003c9a4a333ecdc99ef6773a6df96572f51c11 /R
parente6b9164327957c56de221889e396dcbab6fddd31 (diff)
- Releasable version for CRAN
- Changed usage of cat() to message() because the latter does not interfere with Sweave. Left cat() in checkexperiment.R and checksubstance.R git-svn-id: http://kriemhild.uft.uni-bremen.de/svn/drfit@92 d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc
Diffstat (limited to 'R')
-rw-r--r--R/checkexperiment.R10
-rw-r--r--R/drfit.R10
-rw-r--r--R/drplot.R14
3 files changed, 21 insertions, 13 deletions
diff --git a/R/checkexperiment.R b/R/checkexperiment.R
index 941856b..58fecad 100644
--- a/R/checkexperiment.R
+++ b/R/checkexperiment.R
@@ -11,9 +11,16 @@ checkexperiment <- function(id, db = "ecotox", endpoint = "%")
library(RODBC)
channel <- odbcConnect(db,uid="cytotox",pwd="cytotox",case="tolower")
+
responsename = as.character(databases[db,1])
testtype = as.character(databases[db,2])
exptype = as.character(databases[db,3])
+
+ exptable <- paste(exptype, "s", sep="")
+ commentquery <- paste("SELECT comment FROM ", exptable ,
+ " WHERE ", exptype, " = ", id)
+ commentdata <- sqlQuery(channel,commentquery)
+ comment <- as.character(commentdata[[1]])
expquery <- paste("SELECT experimentator,substance, ",
testtype, ",conc,unit,", responsename, ",performed,ok",
@@ -83,7 +90,8 @@ checkexperiment <- function(id, db = "ecotox", endpoint = "%")
"\tPerformed on:\t\t",levels(expdata$performed),"\n",
"\tSubstance(s):\t\t",levels(expdata$substance),"\n",
"\tConcentration unit(s):\t",levels(expdata$unit),"\n",
- "\tOK:\t\t\t",levels(expdata$ok),"\n",
+ "\tComment:\t\t",comment,"\n",
+ "\tOK Levels:\t\t\t",levels(expdata$ok),"\n",
"\t\tNumber \tMean \tStd. Dev. \t% Std. Dev.\n",
"\tblind\t",numberOfBlinds,"\t",meanOfBlinds,"\t",stdOfBlinds,"\n",
"\tcontrol\t",numberOfControls,"\t",meanOfControls,"\t",
diff --git a/R/drfit.R b/R/drfit.R
index 3bd9021..462bc43 100644
--- a/R/drfit.R
+++ b/R/drfit.R
@@ -32,13 +32,13 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
fit <- FALSE
if (length(tmp) != 0) {
unit <- levels(as.factor(as.vector(tmp$unit)))
- cat("\n",i,": Fitting data...\n",sep="")
+ message("\n",i,": Fitting data...\n")
} else {
unit <- ""
- cat("\n",i,": No data\n",sep="")
+ message("\n",i,": No data\n")
}
if (length(unit) > 1) {
- cat("More than one unit for substance ",i,", halting\n\n",sep="")
+ message("More than one unit for substance ",i,", halting\n\n")
break
}
if (length(tmp$response) == 0) {
@@ -211,8 +211,8 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
}
logED50[[ri]] <- nlm(sqrdev,startlogED50[[i]])$estimate
if (sqrdev(logED50[[ri]]) > 0.1) {
- cat("\nCan't find ED50 for fitted weibull model of ",i,
- "data\nwith startlogED50", startlogED50[[i]],"\n")
+ message("\nCan't find ED50 for fitted weibull model of ",i,
+ " data\nwith startlogED50 ", startlogED50[[i]],"\n")
ri <- ri - 1
length(a) <- length(b) <- ri
length(logED50) <- ri
diff --git a/R/drplot.R b/R/drplot.R
index 08a92d1..507119c 100644
--- a/R/drplot.R
+++ b/R/drplot.R
@@ -65,19 +65,19 @@ drplot <- function(drresults, data,
filename = paste(path,fileprefix,".eps",sep="")
postscript(file=filename,
paper="special",width=7,height=7,horizontal=FALSE, pointsize=pointsize)
- cat("Created File: ",filename,"\n")
+ message("Created File: ",filename,"\n")
}
if (pdf) {
filename = paste(path,fileprefix,".pdf",sep="")
pdf(file=filename,
paper="special",width=7,height=7,horizontal=FALSE, pointsize=pointsize)
- cat("Created File: ",filename,"\n")
+ message("Created File: ",filename,"\n")
}
if (png) {
filename = paste(path,fileprefix,".png",sep="")
png(filename=filename,
width=500, height=500, pointsize=pointsize)
- cat("Created File: ",filename,"\n")
+ message("Created File: ",filename,"\n")
}
plot(0,type="n",
@@ -114,19 +114,19 @@ drplot <- function(drresults, data,
filename = paste(path,fileprefix,sub(" ","_",i),".eps",sep="")
postscript(file=filename,
paper="special",width=7,height=7,horizontal=FALSE,pointsize=pointsize)
- cat("Created File: ",filename,"\n")
+ message("Created File: ",filename,"\n")
}
if (pdf) {
filename = paste(path,fileprefix,sub(" ","_",i),".pdf",sep="")
pdf(file=filename,
paper="special",width=7,height=7,horizontal=FALSE,pointsize=pointsize)
- cat("Created File: ",filename,"\n")
+ message("Created File: ",filename,"\n")
}
if (png) {
filename = paste(path,fileprefix,sub(" ","_",i),".png",sep="")
png(filename=filename,
width=500, height=500, pointsize=pointsize)
- cat("Created File: ",filename,"\n")
+ message("Created File: ",filename,"\n")
}
plot(0,type="n",
@@ -222,7 +222,7 @@ drplot <- function(drresults, data,
}
if (!overlay && (postscript || png || pdf)) dev.off()
} else {
- cat("No data for ",i,"\n")
+ message("No data for ",i,"\n")
}
}
}

Contact - Imprint