From 431b88f2b47522a7c92510ed44ab0711a3ed8e33 Mon Sep 17 00:00:00 2001 From: ranke Date: Tue, 26 Apr 2005 14:23:35 +0000 Subject: The drdata and the drfit function can now handle data with "no fit" entries in the "ok" column. They are not used for fitting, but they are plotted. git-svn-id: http://kriemhild.uft.uni-bremen.de/svn/drfit@21 d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc --- DESCRIPTION | 2 +- R/drfit.R | 7 ++++--- man/drdata.Rd | 10 ++++++---- man/drfit.Rd | 4 +++- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 569a2a8..2b3612c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: drfit -Version: 0.03-20 +Version: 0.03-21 Date: 2005-03-17 Title: Dose-response data evaluation Author: Johannes Ranke diff --git a/R/drfit.R b/R/drfit.R index 987c324..da5b34d 100644 --- a/R/drfit.R +++ b/R/drfit.R @@ -1,6 +1,6 @@ drdata <- function(substances, experimentator = "%", db = "cytotox", celltype="IPC-81",enzymetype="AChE",whereClause="1", - ok="'ok'") + ok="'ok','no fit'") { library(RODBC) channel <- odbcConnect(db,uid="cytotox",pwd="cytotox",case="tolower") @@ -41,6 +41,7 @@ drfit <- function(data, startlogEC50 = NA, chooseone=TRUE, linearlogis = FALSE, linearlogisWrong = NA, b0 = 2, f0 = 0) { + if(!is.null(data$ok)) data <- subset(data,ok!="no fit") substances <- levels(data$substance) unit <- levels(as.factor(data$unit)) @@ -269,7 +270,7 @@ drplot <- function(drresults, data, dtype = "std", alpha = 0.95, cat("Created File: ",filename,"\n") } if (!postscript && !png) { - x11(width=7,height=7,pointsize=12) + get(getOption("device"))(width=7,height=7,pointsize=12) } plot(0,type="n", @@ -306,7 +307,7 @@ drplot <- function(drresults, data, dtype = "std", alpha = 0.95, cat("Created File: ",filename,"\n") } if (!postscript && !png) { - x11(width=7,height=7,pointsize=12) + get(getOption("device"))(width=7,height=7,pointsize=12) } plot(0,type="n", diff --git a/man/drdata.Rd b/man/drdata.Rd index ef1d104..de5e625 100644 --- a/man/drdata.Rd +++ b/man/drdata.Rd @@ -27,9 +27,11 @@ With this argument, additional conditions for the SQL query can be set, e.g. "where plate != 710". The default is 1 (in SQL syntax this means TRUE).} \item{ok}{ - With the default value "'ok'", only data that has been checked and set to "ok" - in the database is retrieved. Another sensible argument would be "'ok','?'", in - order to additionally retrieve data which has not yet been checked.} + With the default value "'ok','no fit'", only data that has been checked and set to "ok" + or "no fit" in the database is retrieved. The argument "no fit" means will result in + not using the data for fitting, but it will be plotted. + Another sensible argument would be "'ok','no fit','?'", in order to additionally + retrieve data which has not yet been checked.} } \value{ \item{data}{ @@ -68,7 +70,7 @@ } \examples{ # Get cytotoxicity data for Tributyltin and zinc pyrithione, tested with IPC-81 cells -\dontrun{data <- drdata(c("TBT","Zn Pyrithion"))} +\dontrun{data <- drdata(c("TBT","ZnPT2"))} } \author{ Johannes Ranke diff --git a/man/drfit.Rd b/man/drfit.Rd index ddcf80b..42bbd07 100644 --- a/man/drfit.Rd +++ b/man/drfit.Rd @@ -17,7 +17,9 @@ response values of the test system normalized between 0 and 1 and a column "dose" with the numeric dose values. For later use of the \code{\link{drplot}} function, a factor called "dosefactor" also has to be - present, containing the dose as a factor. + present, containing the dose as a factor. If there is a column called "ok" + and it is set to "no fit", then the corresponding data point will be excluded + from the fitting procedure. } \item{startlogEC50}{ Especially for the linearlogis model, a suitable log10 of the EC50 has to be given -- cgit v1.2.1