aboutsummaryrefslogtreecommitdiff
path: root/R/drfit.R
diff options
context:
space:
mode:
authorranke <ranke@d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc>2006-01-02 23:27:32 +0000
committerranke <ranke@d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc>2006-01-02 23:27:32 +0000
commitee0075c98998e42eef031cd41ed8f8bb403b47ed (patch)
tree8564b7cc34f6940686ba359138c0fe19e3544e35 /R/drfit.R
parentfdd212ca853af2b41736ba6e1cd539feb5f145de (diff)
A fix for a bug that kept drplot from plotting if no control data
are present in the dose-response data frame. git-svn-id: http://kriemhild.uft.uni-bremen.de/svn/drfit@55 d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc
Diffstat (limited to 'R/drfit.R')
-rw-r--r--R/drfit.R5
1 files changed, 2 insertions, 3 deletions
diff --git a/R/drfit.R b/R/drfit.R
index ac3ad3e..9eee87a 100644
--- a/R/drfit.R
+++ b/R/drfit.R
@@ -34,7 +34,6 @@ drdata <- function(substances, experimentator = "%", db = "cytotox",
odbcClose(channel)
names(data)[[1]] <- "dose"
names(data)[[2]] <- "response"
- data$dosefactor <- factor(data$dose)
data$substance <- factor(data$substance,levels=substances)
return(data)
}
@@ -308,9 +307,9 @@ drplot <- function(drresults, data,
nonzerodata$substance <- factor(nonzerodata$substance) # Get rid of pseudo substance names of controls
zerodata <- subset(data,dose==0)
nc <- length(zerodata$dose) # Number of control points
- sdc <- sd(zerodata$response) # Standard deviation of control responses
- controlconf <- sdc * qt((1 + alpha)/2, nc - 1) / sqrt(nc)
if (nc > 0) {
+ sdc <- sd(zerodata$response) # Standard deviation of control responses
+ controlconf <- sdc * qt((1 + alpha)/2, nc - 1) / sqrt(nc)
cat("There are ",nc,"data points with dose 0 (control values)\n")
cat("with a standard deviation of",sdc,"\n")
cat("and a confidence interval of",controlconf,"\n")

Contact - Imprint