diff options
author | ranke <ranke@d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc> | 2006-01-02 23:27:32 +0000 |
---|---|---|
committer | ranke <ranke@d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc> | 2006-01-02 23:27:32 +0000 |
commit | ee0075c98998e42eef031cd41ed8f8bb403b47ed (patch) | |
tree | 8564b7cc34f6940686ba359138c0fe19e3544e35 /R | |
parent | fdd212ca853af2b41736ba6e1cd539feb5f145de (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')
-rw-r--r-- | R/drfit.R | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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") |