aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2017-03-30 17:54:16 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2017-03-30 17:54:16 +0200
commitfec95dfbf0abe4175649e399eb1fcd698d482a9a (patch)
tree6d9a95ab2b129f5929d92a8851f96af4ec80b911
parent12a712a7b0cb0f755354f7a1f4e6e2d4c264fd13 (diff)
Add checkcontrols, updates, see ChangeLog
-rw-r--r--ChangeLog14
-rw-r--r--DESCRIPTION6
-rw-r--r--GNUmakefile5
-rw-r--r--R/checkexperiment.R28
-rw-r--r--R/checksubstance.R52
-rw-r--r--R/drcfit.R34
-rw-r--r--R/drdata.R2
-rw-r--r--R/drfit.R47
-rw-r--r--R/drplot.R36
-rw-r--r--check.log17
-rw-r--r--docs/index.html10
-rw-r--r--docs/reference/antifoul.html29
-rw-r--r--docs/reference/drcfit.html11
-rw-r--r--man/IM1xIPC81.Rd2
-rw-r--r--man/IM1xVibrio.Rd8
-rw-r--r--man/XY.Rd2
-rw-r--r--man/antifoul.Rd12
-rw-r--r--man/checkcontrols.Rd12
-rw-r--r--man/checkexperiment.Rd4
-rw-r--r--man/checksubstance.Rd14
-rw-r--r--man/drcfit.Rd20
-rw-r--r--man/drdata.Rd22
-rw-r--r--man/drfit-package.Rd2
-rw-r--r--man/drfit.Rd22
-rw-r--r--man/drplot.Rd26
-rw-r--r--[-rwxr-xr-x]man/linlogitf.Rd6
-rw-r--r--tests/IM1xIPC81.Rout.save29
-rw-r--r--tests/pyrithione.Rout.save14
28 files changed, 268 insertions, 218 deletions
diff --git a/ChangeLog b/ChangeLog
index 3e539fa..132c7c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,18 @@
-2017-03-24 Johannes Ranke
+2017-03-30 Johannes Ranke
* DESCRIPTION: New verson 0.7.1
+ * Change package encoding to UTF-8
* Add checkcontrols() function
* Add static documentation using pkgdown
+ * R/drfit.R: Suppress error messages to pass CRAN checks for examples
+ * Update test results
+ * Remove trailing whitespace and mixed indentation in source files
2016-09-02 Johannes Ranke
* Make drcfit compatible with drc >= 3.0.1 (the row names of the matrix
returned by the ED() function were changed).
- * Switch back to using requireNamespace(RODBC) in order to address
+ * Switch back to using requireNamespace(RODBC) in order to address
a NOTE issued by R CMD check
* Use single quotes to quote other packages in the DESCRIPTION file
@@ -20,7 +24,7 @@
2015-10-07 Johannes Ranke
* Suggest RODBC instead of depending on it, as it is not available
- on all CRAN check systems.
+ on all CRAN check systems.
* Adress various NOTES given by R CMD check
@@ -43,12 +47,12 @@
drfit(), but internally uses the methods supplied by the drc package
* R/{drfit,drcfit}.R: Return the list of fitted models in an attribute of
- the resulting dataframe. Deal with the case of only NA values in the unit
+ the resulting dataframe. Deal with the case of only NA values in the unit
column of the data.
* R/drfit.R: Use the fitted nls() models directly to calculate EDx values
- * R/drplot.R: Use different point characters (pch) for the data, and add the
+ * R/drplot.R: Use different point characters (pch) for the data, and add the
possibility to specify them using the argument pchs. Also make drplot() work
for the results from the drcfit function.
diff --git a/DESCRIPTION b/DESCRIPTION
index 452e608..ae9f00d 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,8 +1,8 @@
Package: drfit
Version: 0.7.1
-Date: 2017-03-24
+Date: 2017-03-30
Title: Dose-Response Data Evaluation
-Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre"),
+Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre"),
email = "jranke@uni-bremen.de"))
Imports: graphics, grDevices, MASS, drc, reshape2, qcc
Suggests: RODBC
@@ -18,7 +18,7 @@ Description: A somewhat outdated package of basic and easy-to-use functions for
dose-response data retrieved from a database accessed via 'RODBC' are included.
As an alternative to the original fitting methods, the algorithms from the 'drc'
package can be used.
-Encoding: latin1
+Encoding: UTF-8
License: GPL (>= 2)
LazyLoad: yes
LazyData: yes
diff --git a/GNUmakefile b/GNUmakefile
index 7f7e85c..59f3835 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -16,7 +16,10 @@ install: build
"$(RBIN)/R" CMD INSTALL $(TGZ)
check: build
- "$(RBIN)/R" CMD check --as-cran --no-tests $(TGZ) 2>&1 | tee check.log
+ "$(RBIN)/R" CMD check --as-cran $(TGZ) 2>&1 | tee check.log
+
+quickcheck: build
+ "$(RBIN)/R" CMD check $(TGZ) 2>&1 | tee check.log
pd:
"$(RBIN)/Rscript" -e "pkgdown::build_site()"
diff --git a/R/checkexperiment.R b/R/checkexperiment.R
index 8c2f472..b69b81f 100644
--- a/R/checkexperiment.R
+++ b/R/checkexperiment.R
@@ -25,21 +25,21 @@ checkexperiment <- function(id, db = "ecotox", endpoint = "%")
" WHERE ", exptype, " = ", id)
commentdata <- RODBC::sqlQuery(channel,commentquery)
comment <- as.character(commentdata[[1]])
-
+
expquery <- paste("SELECT experimentator,substance, ",
testtype, ",conc,unit,", responsename, ",performed,ok",
- " FROM ",db," WHERE ",exptype,"=", id,
+ " FROM ",db," WHERE ",exptype,"=", id,
sep = "")
if (db == "ecotox") {
- expquery <- paste(expquery, " AND type LIKE '",
+ expquery <- paste(expquery, " AND type LIKE '",
endpoint, "'", sep = "")
}
expdata <- RODBC::sqlQuery(channel,expquery)
if (db %in% c("cytotox","enzymes")) {
- controlquery <- paste("SELECT type,response FROM controls
+ controlquery <- paste("SELECT type,response FROM controls
WHERE plate=",id)
controldata <- RODBC::sqlQuery(channel,controlquery)
}
@@ -63,7 +63,7 @@ checkexperiment <- function(id, db = "ecotox", endpoint = "%")
numberOfBlinds <- NA
meanOfBlinds <- NA
stdOfBlinds <- NA
-
+
}
numberOfControls <- length(controls$response)
if (numberOfControls > 0) {
@@ -78,7 +78,7 @@ checkexperiment <- function(id, db = "ecotox", endpoint = "%")
if (length(expdata$experimentator) < 1) {
stop("There is no response data for ",exptype," ",
id," in database ",db,"\n")
- }
+ }
exptypestring <- paste(toupper(substring(exptype,1,1)),
substring(exptype,2),sep="")
expdata$experimentator <- factor(expdata$experimentator)
@@ -87,7 +87,7 @@ checkexperiment <- function(id, db = "ecotox", endpoint = "%")
expdata$substance <- factor(expdata$substance)
expdata$unit <- factor(expdata$unit)
expdata$ok <- factor(expdata$ok)
-
+
cat("\n",exptypestring,id,"from database",db,":\n\n",
"\tExperimentator(s):\t",levels(expdata$experimentator),"\n",
"\tType(s):\t\t",levels(expdata$type),"\n",
@@ -100,7 +100,7 @@ checkexperiment <- function(id, db = "ecotox", endpoint = "%")
"\tblind\t",numberOfBlinds,"\t",meanOfBlinds,"\t",stdOfBlinds,"\n",
"\tcontrol\t",numberOfControls,"\t",meanOfControls,"\t",
stdOfControls,"\t\t",percentstdOfcontrols,"\n")
-
+
if (db == "ecotox") {
boxplot(controls$response,
@@ -116,22 +116,22 @@ checkexperiment <- function(id, db = "ecotox", endpoint = "%")
boxwex=0.4,
main=paste("Plate ",id))
}
-
+
drdata <- expdata[c(2,4,6)]
drdata$substance <- factor(drdata$substance)
substances <- levels(drdata$substance)
-
+
lld <- log10(min(subset(drdata,conc!=0)$conc))
lhd <- log10(max(drdata$conc))
plot(1,type="n",
- xlim=c(lld - 0.5, lhd + 2),
- ylim= c(-0.1, 2),
+ xlim=c(lld - 0.5, lhd + 2),
+ ylim= c(-0.1, 2),
xlab=paste("decadic logarithm of the concentration in ",levels(expdata$unit)),
ylab=responsename)
-
+
drdatalist <- split(drdata,drdata$substance)
-
+
for (i in 1:length(drdatalist)) {
points(log10(drdatalist[[i]]$conc),drdatalist[[i]][[responsename]],col=i);
}
diff --git a/R/checksubstance.R b/R/checksubstance.R
index 3e07f92..06cc635 100644
--- a/R/checksubstance.R
+++ b/R/checksubstance.R
@@ -1,7 +1,7 @@
checksubstance <- function(substance, db = "cytotox", experimentator = "%",
- celltype = "%", enzymetype = "%", organism = "%",
+ celltype = "%", enzymetype = "%", organism = "%",
endpoint = "%",
- whereClause = "1", ok= "%")
+ whereClause = "1", ok= "%")
{
databases <- data.frame(
responsename=c("viability","activity","response"),
@@ -23,13 +23,13 @@ checksubstance <- function(substance, db = "cytotox", experimentator = "%",
if (db == "cytotox") {
type <- celltype
- }
+ }
if (db == "enzymes") {
type <- enzymetype
- }
+ }
if (db == "ecotox") {
type <- organism
- }
+ }
query <- paste("SELECT experimentator,substance,",
testtype, ",", exptype, ",conc,unit,",responsename,",ok",
@@ -41,7 +41,7 @@ checksubstance <- function(substance, db = "cytotox", experimentator = "%",
sep = "")
if (db == "ecotox") {
- query <- paste(query, " AND type LIKE '",
+ query <- paste(query, " AND type LIKE '",
endpoint, "'", sep = "")
}
@@ -51,39 +51,39 @@ checksubstance <- function(substance, db = "cytotox", experimentator = "%",
if (length(data$experimentator) < 1) {
stop(paste("\nNo response data for",substance,"in database",
db,"found with these parameters\n"))
- }
-
- data$experimentator <- factor(data$experimentator)
+ }
+
+ data$experimentator <- factor(data$experimentator)
data$substance <- factor(data$substance)
- substances <- levels(data$substance)
- data$type <- factor(data[[testtype]])
- data[[exptype]] <- factor(data[[exptype]])
+ substances <- levels(data$substance)
+ data$type <- factor(data[[testtype]])
+ data[[exptype]] <- factor(data[[exptype]])
experiments <- levels(data[[exptype]])
concentrations <- split(data$conc,data$conc)
concentrations <- as.numeric(names(concentrations))
- data$unit <- factor(data$unit)
+ data$unit <- factor(data$unit)
data$ok <- factor(data$ok)
if (length(experiments)>6) {
- palette(rainbow(length(experiments)))
+ palette(rainbow(length(experiments)))
}
-
+
plot(log10(data$conc),data[[responsename]],
- xlim=c(-2.5, 4.5),
- ylim= c(-0.1, 2),
- xlab=paste("decadic logarithm of the concentration in ",levels(data$unit)),
- ylab=responsename)
-
+ xlim=c(-2.5, 4.5),
+ ylim= c(-0.1, 2),
+ xlab=paste("decadic logarithm of the concentration in ",levels(data$unit)),
+ ylab=responsename)
+
explist <- split(data,data[[exptype]])
-
- for (i in 1:length(explist)) {
- points(log10(explist[[i]]$conc),explist[[i]][[responsename]],col=i);
- }
-
+
+ for (i in 1:length(explist)) {
+ points(log10(explist[[i]]$conc),explist[[i]][[responsename]],col=i);
+ }
+
legend("topleft", experiments, pch=1, col=1:length(experiments), inset=0.05)
title(main=paste(substance," - ",levels(data$experimentator)," - ",levels(data$type)))
- exptypename <- paste(toupper(substring(exptype,1,1)),
+ exptypename <- paste(toupper(substring(exptype,1,1)),
substring(exptype,2), sep = "")
experimentators <- paste(levels(data$experimentator), collapse = " ")
types <- paste(levels(data$type), collapse = " ")
diff --git a/R/drcfit.R b/R/drcfit.R
index 008c53c..64426b9 100644
--- a/R/drcfit.R
+++ b/R/drcfit.R
@@ -14,7 +14,7 @@ drcfit <- function(data, chooseone=TRUE,
# model result was appended
rsubstance <- array() # the substance names in the results
rndl <- vector() # number of dose levels
- rn <- vector() # mean number of replicates
+ rn <- vector() # mean number of replicates
# in each dose level
runit <- vector() # vector of units for each result row
rlhd <- rlld <- vector() # highest and lowest doses tested
@@ -79,7 +79,8 @@ drcfit <- function(data, chooseone=TRUE,
active <- FALSE
if (linlogit)
{
- m <- try(drm(response ~ dose, data = tmp, fct = BC.4(fixed = c(NA, 1, NA, NA))))
+ m <- try(drm(response ~ dose, data = tmp, fct = BC.4(fixed = c(NA, 1, NA, NA))),
+ silent = TRUE)
if (chooseone==FALSE || fit==FALSE) {
if (!inherits(m, "try-error")) {
fit <- TRUE
@@ -100,10 +101,11 @@ drcfit <- function(data, chooseone=TRUE,
a[[ri]] <- coef(m)[[2]]
b[[ri]] <- coef(m)[[1]]
c[[ri]] <- coef(m)[[3]]
- ED50 <- try(ED(m, 50, interval = "delta",
+ ED50 <- try(ED(m, 50, interval = "delta",
lower = lowestdose / 10,
upper = highestdose * 10,
- display = FALSE))
+ display = FALSE),
+ silent = TRUE)
if (!inherits(ED50, "try-error")) {
logED50[[ri]] <- log10(ED50[ED50_row_index, "Estimate"])
logED50low[[ri]] <- log10(ED50[ED50_row_index, "Lower"])
@@ -111,14 +113,15 @@ drcfit <- function(data, chooseone=TRUE,
if (logED50[[ri]] > rlhd[[ri]]) {
mtype[[ri]] <- "no fit"
}
- }
+ }
}
}
}
if (probit)
{
- m <- try(drm(response ~ dose, data = tmp,
- fct = LN.2()))
+ m <- try(drm(response ~ dose, data = tmp,
+ fct = LN.2()),
+ silent = TRUE)
if (chooseone==FALSE || fit==FALSE) {
if (!inherits(m, "try-error")) {
fit <- TRUE
@@ -152,7 +155,8 @@ drcfit <- function(data, chooseone=TRUE,
}
if (logit)
{
- m <- try(drm(response ~ dose, data = tmp, fct = LL.2()))
+ m <- try(drm(response ~ dose, data = tmp, fct = LL.2()),
+ silent = TRUE)
if (chooseone==FALSE || fit==FALSE) {
if (!inherits(m, "try-error")) {
fit <- TRUE
@@ -189,7 +193,8 @@ drcfit <- function(data, chooseone=TRUE,
}
if (weibull)
{
- m <- try(drm(response ~ dose, data = tmp, fct = W1.2()))
+ m <- try(drm(response ~ dose, data = tmp, fct = W1.2()),
+ silent = TRUE)
if (chooseone==FALSE || fit==FALSE) {
if (!inherits(m, "try-error")) {
fit <- TRUE
@@ -262,7 +267,7 @@ drcfit <- function(data, chooseone=TRUE,
}
}
- results <- data.frame(rsubstance, rndl, rn, rlld, rlhd, mtype,
+ results <- data.frame(rsubstance, rndl, rn, rlld, rlhd, mtype,
logED50, logED50low, logED50high, runit, sigma, a, b)
lower_level_percent = paste(100 * (1 - level)/2, "%", sep = "")
upper_level_percent = paste(100 * (1 + level)/2, "%", sep = "")
@@ -285,13 +290,14 @@ drcfit <- function(data, chooseone=TRUE,
mtype <- as.character(results[row.i, "mtype"])
if (mtype %in% c("probit", "logit", "weibull", "linlogit")) {
for (EDi in EDx) {
- EDx.drc = try(ED(m, EDi, interval = "delta", display = FALSE, level = level))
+ EDx.drc = try(ED(m, EDi, interval = "delta", display = FALSE, level = level),
+ silent = TRUE)
if (!inherits(EDx.drc, "try-error")) {
- results[row.i, paste0("EDx", EDi)] <-
+ results[row.i, paste0("EDx", EDi)] <-
EDx.drc[paste(EDx_row_index_prefix, EDi, sep = ":"), "Estimate"]
- results[row.i, paste0("EDx", EDi, " ", lower_level_percent)] <-
+ results[row.i, paste0("EDx", EDi, " ", lower_level_percent)] <-
EDx.drc[paste(EDx_row_index_prefix, EDi, sep = ":"), "Lower"]
- results[row.i, paste0("EDx", EDi, " ", upper_level_percent)] <-
+ results[row.i, paste0("EDx", EDi, " ", upper_level_percent)] <-
EDx.drc[paste(EDx_row_index_prefix, EDi, sep = ":"), "Upper"]
}
}
diff --git a/R/drdata.R b/R/drdata.R
index 0bf9597..dc741a6 100644
--- a/R/drdata.R
+++ b/R/drdata.R
@@ -21,7 +21,7 @@ drdata <- function(substances, experimentator = "%", db = "cytotox",
type <- organism
}
}
-
+
query <- paste("SELECT conc,",responsetype,",unit,experimentator,substance,",testtype,
",ok FROM ", db, " WHERE substance IN ('",
slist,"') AND experimentator LIKE '",
diff --git a/R/drfit.R b/R/drfit.R
index 7fa53bf..65ab8e4 100644
--- a/R/drfit.R
+++ b/R/drfit.R
@@ -18,7 +18,7 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
# model result was appended
rsubstance <- array() # the substance names in the results
rndl <- vector() # number of dose levels
- rn <- vector() # mean number of replicates
+ rn <- vector() # mean number of replicates
# in each dose level
runit <- vector() # vector of units for each result row
rlhd <- rlld <- vector() # highest and lowest doses tested
@@ -75,12 +75,13 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
active <- TRUE
} else {
active <- FALSE
- if (linlogit &&
+ if (linlogit &&
length(subset(linlogitWrong,linlogitWrong == i))==0 &&
length(subset(allWrong,allWrong == i))==0) {
m <- try(nls(response ~ linlogitf(dose,1,f,logED50,b),
- data=tmp, algorithm="port",
- start=list(f=f0,logED50=startlogED50[[i]],b=b0)))
+ data=tmp, algorithm="port",
+ start=list(f=f0,logED50=startlogED50[[i]],b=b0)),
+ silent = TRUE)
if (!inherits(m, "try-error")) {
fit <- TRUE
ri <- ri + 1
@@ -104,7 +105,8 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
c[[ri]] <- NA
} else {
mtype[[ri]] <- "linlogit"
- logED50conf <- try(confint(m,"logED50",level=level))
+ logED50conf <- try(confint(m,"logED50",level=level),
+ silent = TRUE)
if (!inherits(logED50conf, "try-error")) {
logED50low[[ri]] <- logED50conf[[1]]
logED50high[[ri]] <- logED50conf[[2]]
@@ -122,8 +124,9 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
if (probit &&
length(subset(allWrong,allWrong == i))==0) {
m <- try(nls(response ~ pnorm(-log10(dose),-logED50,scale),
- data=tmp, algorithm="port",
- start=list(logED50=startlogED50[[i]],scale=ps0)))
+ data=tmp, algorithm="port",
+ start=list(logED50=startlogED50[[i]],scale=ps0)),
+ silent = TRUE)
if (chooseone==FALSE || fit==FALSE) {
if (!inherits(m, "try-error")) {
fit <- TRUE
@@ -148,7 +151,8 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
b[[ri]] <- NA
} else {
mtype[[ri]] <- "probit"
- logED50conf <- try(confint(m,"logED50",level=level))
+ logED50conf <- try(confint(m,"logED50",level=level),
+ silent = TRUE)
if (!inherits(logED50conf, "try-error")) {
logED50low[[ri]] <- logED50conf[[1]]
logED50high[[ri]] <- logED50conf[[2]]
@@ -166,8 +170,9 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
if (logit &&
length(subset(allWrong,allWrong == i))==0) {
m <- try(nls(response ~ plogis(-log10(dose),-logED50,scale),
- data=tmp, algorithm="port",
- start=list(logED50=startlogED50[[i]],scale=ls0)))
+ data=tmp, algorithm="port",
+ start=list(logED50=startlogED50[[i]],scale=ls0)),
+ silent = TRUE)
if (chooseone==FALSE || fit==FALSE) {
if (!inherits(m, "try-error")) {
fit <- TRUE
@@ -193,7 +198,8 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
b[[ri]] <- NA
} else {
mtype[[ri]] <- "logit"
- logED50conf <- try(confint(m,"logED50",level=level))
+ logED50conf <- try(confint(m,"logED50",level=level),
+ silent = TRUE)
if (!inherits(logED50conf, "try-error")) {
logED50low[[ri]] <- logED50conf[[1]]
logED50high[[ri]] <- logED50conf[[2]]
@@ -209,8 +215,9 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
if (weibull &&
length(subset(allWrong,allWrong == i))==0) {
m <- try(nls(response ~ pweibull(-log10(dose)+location,shape),
- data=tmp, algorithm="port",
- start=list(location=startlogED50[[i]],shape=ws0)))
+ data=tmp, algorithm="port",
+ start=list(location=startlogED50[[i]],shape=ws0)),
+ silent = TRUE)
if (chooseone==FALSE || fit==FALSE) {
if (!inherits(m, "try-error")) {
ri <- ri + 1
@@ -218,7 +225,7 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
a[[ri]] <- coef(m)[["location"]]
b[[ri]] <- coef(m)[["shape"]]
sqrdev <- function(logdose) {
- (0.5 - pweibull( - logdose + a[[ri]], b[[ri]]))^2
+ (0.5 - pweibull( - logdose + a[[ri]], b[[ri]]))^2
}
logED50[[ri]] <- nlm(sqrdev,startlogED50[[i]])$estimate
if (sqrdev(logED50[[ri]]) > 0.1) {
@@ -291,7 +298,7 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
c[[ri]] <- NA
}
}
- results <- data.frame(rsubstance, rndl, rn, rlld, rlhd, mtype,
+ results <- data.frame(rsubstance, rndl, rn, rlld, rlhd, mtype,
logED50, logED50low, logED50high, runit, sigma, a, b)
lower_level_percent = paste(100 * (1 - level)/2, "%", sep = "")
upper_level_percent = paste(100 * (1 + level)/2, "%", sep = "")
@@ -311,18 +318,18 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
if (mtype[[row.i]] %in% c("probit", "logit", "weibull", "linlogit")) {
for (ED in EDx) {
of <- function(x) {
- abs(predict(models[[row.i]], data.frame(dose = 10^x)) -
+ abs(predict(models[[row.i]], data.frame(dose = 10^x)) -
(1 - (ED/100)))
- }
- # Search over interval starting an order of magnitude below
+ }
+ # Search over interval starting an order of magnitude below
# the lowest dose up to one order of magnitude above the
# highest dose
- o = optimize(of,
+ o = optimize(of,
results[row.i, c("lld", "lhd")] + c(-1, 1))
# Only keep results within the tolerance
if ((o$objective) < EDx.tolerance) {
logdose.ED = o$minimum
- results[row.i, paste0("EDx", ED)] <- 10^logdose.ED
+ results[row.i, paste0("EDx", ED)] <- 10^logdose.ED
}
}
}
diff --git a/R/drplot.R b/R/drplot.R
index 11c4d42..1e6b2cd 100644
--- a/R/drplot.R
+++ b/R/drplot.R
@@ -1,12 +1,12 @@
if(getRversion() >= '2.15.1') utils::globalVariables(c("dose", "Substance", "mtype"))
-drplot <- function(drresults, data,
+drplot <- function(drresults, data,
dtype = "std", alpha = 0.95, ctype = "none",
path = "./", fileprefix = "drplot", overlay = FALSE,
xlim = c("auto","auto"), ylim = c("auto","auto"),
xlab = paste("Decadic Logarithm of the dose in ", unit),
ylab = "Normalized response",
axes = TRUE, frame.plot = TRUE,
- postscript = FALSE, pdf = FALSE, png = FALSE,
+ postscript = FALSE, pdf = FALSE, png = FALSE,
bw = TRUE,
pointsize = 12,
colors = 1:8, ltys = 1:8, pchs = "auto",
@@ -24,7 +24,7 @@ drplot <- function(drresults, data,
if(is.data.frame(data)) {
# Get rid of pseudo substance names of controls
nonzerodata <- subset(data,dose!=0)
- nonzerodata$substance <- factor(nonzerodata$substance)
+ nonzerodata$substance <- factor(nonzerodata$substance)
zerodata <- subset(data,dose==0)
nc <- length(zerodata$dose) # Number of control points
if (nc > 0) {
@@ -44,12 +44,12 @@ drplot <- function(drresults, data,
hr <- max(nonzerodata$response)
if (ctype == "std") hr <- max(hr,1 + sdc)
if (ctype == "conf") hr <- max(hr,1 + controlconf)
- dsubstances <- levels(nonzerodata$substance)
+ dsubstances <- levels(nonzerodata$substance)
} else {
lld <- min(drresults[["logED50"]],na.rm=TRUE) - 2
lhd <- max(drresults[["logED50"]],na.rm=TRUE) + 2
if (length(subset(drresults,mtype=="linlogit")$Substance) != 0) {
- hr <- 1.8
+ hr <- 1.8
} else {
hr <- 1.0
}
@@ -70,20 +70,20 @@ drplot <- function(drresults, data,
postscript(file=filename,
paper="special",width=7,height=7,horizontal=FALSE, pointsize=pointsize)
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)
message("Created File: ",filename,"\n")
- }
+ }
if (png) {
filename = paste(path,fileprefix,".png",sep="")
png(filename=filename,
width=500, height=500, pointsize=pointsize)
message("Created File: ",filename,"\n")
}
-
+
plot(0,type="n",
xlim = xlim,
ylim = ylim,
@@ -97,7 +97,7 @@ drplot <- function(drresults, data,
if (!postscript && !png && !pdf && length(dsubstances) > 1) {
op <- par(ask=TRUE)
on.exit(par(op))
- }
+ }
}
# nl is the overall number of fits to draw by different line types
nl <- 0
@@ -123,20 +123,20 @@ drplot <- function(drresults, data,
postscript(file=filename,
paper="special",width=7,height=7,horizontal=FALSE,pointsize=pointsize)
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)
message("Created File: ",filename,"\n")
- }
+ }
if (png) {
filename = paste(path,fileprefix,sub(" ","_",i),".png",sep="")
png(filename=filename,
width=500, height=500, pointsize=pointsize)
message("Created File: ",filename,"\n")
}
-
+
plot(0,type="n",
xlim = xlim,
ylim = ylim,
@@ -147,7 +147,7 @@ drplot <- function(drresults, data,
}
if (!overlay) legend(lpos, i, lty = 1, col = color, pch = pch, inset=0.05)
tmp$dosefactor <- factor(tmp$dose) # necessary because the old
- # factor has all levels, not
+ # factor has all levels, not
# only the ones tested with
# this substance
@@ -157,7 +157,7 @@ drplot <- function(drresults, data,
abline(h = 1 + sdc, lty = 2)
}
if (ctype == "conf") {
- abline(h = 1 - controlconf, lty = 2)
+ abline(h = 1 - controlconf, lty = 2)
abline(h = 1 + controlconf, lty = 2)
}
@@ -179,7 +179,7 @@ drplot <- function(drresults, data,
}
if (dtype == "conf")
{
- confidencedeltas <- qt((1 + alpha)/2, lengths - 1) * sqrt(vars)
+ confidencedeltas <- qt((1 + alpha)/2, lengths - 1) * sqrt(vars)
tops <- means + confidencedeltas
bottoms <- means - confidencedeltas
}
@@ -207,13 +207,13 @@ drplot <- function(drresults, data,
if (drresults[[fit.row, "mtype"]] %in% c("probit",
"logit",
"weibull",
- "linlogit"))
+ "linlogit"))
{
m <- attr(drresults, "models")[[as.numeric(fit.row)]]
of <- function(x) {
predict(m, data.frame(dose = 10^x))
- }
- plot(of, lld - 0.5, lhd + 2,
+ }
+ plot(of, lld - 0.5, lhd + 2,
add = TRUE, col = color, lty = lty)
}
}
diff --git a/check.log b/check.log
index c074e40..5d1e47c 100644
--- a/check.log
+++ b/check.log
@@ -2,10 +2,10 @@
* using R version 3.3.3 (2017-03-06)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
-* using options ‘--no-tests --as-cran’
+* using option ‘--as-cran’
* checking for file ‘drfit/DESCRIPTION’ ... OK
* this is package ‘drfit’ version ‘0.7.1’
-* package encoding: latin1
+* package encoding: UTF-8
* checking CRAN incoming feasibility ... Note_to_CRAN_maintainers
Maintainer: ‘Johannes Ranke <jranke@uni-bremen.de>’
* checking package namespace information ... OK
@@ -54,7 +54,18 @@ Maintainer: ‘Johannes Ranke <jranke@uni-bremen.de>’
* checking installed files from ‘inst/doc’ ... OK
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
-* checking tests ... SKIPPED
+* checking tests ...
+ Running ‘IM1xIPC81.R’
+ Comparing ‘IM1xIPC81.Rout’ to ‘IM1xIPC81.Rout.save’ ... OK
+ Running ‘IM1xVibrio.R’
+ Comparing ‘IM1xVibrio.Rout’ to ‘IM1xVibrio.Rout.save’ ... OK
+ Running ‘XY.R’
+ Comparing ‘XY.Rout’ to ‘XY.Rout.save’ ... OK
+ Running ‘antifoul.R’
+ Comparing ‘antifoul.Rout’ to ‘antifoul.Rout.save’ ... OK
+ Running ‘pyrithione.R’
+ Comparing ‘pyrithione.Rout’ to ‘pyrithione.Rout.save’ ... OK
+ OK
* checking PDF version of manual ... OK
* DONE
diff --git a/docs/index.html b/docs/index.html
index 3ad6d4a..f6c1903 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -45,15 +45,15 @@
<div class="contents col-md-9">
A somewhat outdated package of basic and easy-to-use functions for
fitting dose-response curves to continuous dose-response data, calculating some
- (eco)toxicological parameters and plotting the results. Please consider using
+ toxicological parameters and plotting the results. Please consider using
the more powerful and actively developed 'drc' package. Functions that are
fitted are the cumulative density function of the lognormal distribution
- (probit fit), of the logistic distribution (logit fit), of the weibull
- distribution (weibull fit) and a linear-logistic model ("linlogit" fit),
+ ('probit' fit), of the logistic distribution ('logit' fit), of the Weibull
+ distribution ('weibull' fit) and a linear-logistic model ('linlogit' fit),
derived from the latter, which is used to describe data showing stimulation at
low doses (hormesis). In addition, functions checking, plotting and retrieving
- dose-response data retrieved from a database accessed via RODBC are included.
- As an alternative to the original fitting methods, the algorithms from the drc
+ dose-response data retrieved from a database accessed via 'RODBC' are included.
+ As an alternative to the original fitting methods, the algorithms from the 'drc'
package can be used.
</div>
diff --git a/docs/reference/antifoul.html b/docs/reference/antifoul.html
index 5a2b886..f5bc9fd 100644
--- a/docs/reference/antifoul.html
+++ b/docs/reference/antifoul.html
@@ -128,7 +128,34 @@
<span class='kw'>linlogit</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>logit</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>weibull</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>chooseone</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>showED50</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>EDx</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='fl'>10</span>))</div><div class='output co'>#&gt; <span class='message'></span>
-#&gt; <span class='message'>TBT: Fitting data...</span></div><div class='output co'>#&gt; <span class='error'>Error in ED50["1:50", "Lower"]: Indizierung außerhalb der Grenzen</span></div><div class='input'><span class='fu'>print</span>(<span class='no'>rantifoul.drc</span>, <span class='kw'>digits</span> <span class='kw'>=</span> <span class='fl'>5</span>)</div><div class='output co'>#&gt; <span class='error'>Error in print(rantifoul.drc, digits = 5): Objekt 'rantifoul.drc' nicht gefunden</span></div></pre>
+#&gt; <span class='message'>TBT: Fitting data...</span></div><div class='output co'>#&gt; <span class='message'></span>
+#&gt; <span class='message'>Zn Pyrithion: Fitting data...</span></div><div class='input'><span class='fu'>print</span>(<span class='no'>rantifoul.drc</span>, <span class='kw'>digits</span> <span class='kw'>=</span> <span class='fl'>5</span>)</div><div class='output co'>#&gt; Substance ndl n lld lhd mtype logED50 2.5% 97.5%
+#&gt; 1 TBT 38 135 -2.7093 2.3979 linlogit NA NA NA
+#&gt; 2 TBT 38 135 -2.7093 2.3979 probit -0.16436 -0.28178 -0.072022
+#&gt; 3 TBT 38 135 -2.7093 2.3979 logit -0.16012 -0.27782 -0.067603
+#&gt; 4 TBT 38 135 -2.7093 2.3979 weibull -0.13012 -0.23786 -0.043860
+#&gt; 5 Zn Pyrithion 27 81 -2.1072 2.0000 linlogit -0.41330 -0.54457 -0.312631
+#&gt; 6 Zn Pyrithion 27 81 -2.1072 2.0000 probit -0.39792 -0.52005 -0.302705
+#&gt; 7 Zn Pyrithion 27 81 -2.1072 2.0000 logit -0.40035 -0.52324 -0.304676
+#&gt; 8 Zn Pyrithion 27 81 -2.1072 2.0000 weibull -0.37351 -0.49792 -0.276917
+#&gt; unit sigma a b c ED50 ED50 2.5% ED50 97.5%
+#&gt; 1 microM 0.19264 0.71806 1.04061 -0.024169 NA NA NA
+#&gt; 2 microM 0.19286 0.68492 -0.64209 NA 0.68492 0.52267 0.84718
+#&gt; 3 microM 0.19199 0.69165 1.05007 NA 0.69165 0.52744 0.85585
+#&gt; 4 microM 0.18900 -0.13012 0.79816 NA 0.74111 0.57828 0.90394
+#&gt; 5 microM 0.22878 0.30926 1.74257 0.611358 0.38610 0.28538 0.48682
+#&gt; 6 microM 0.22866 0.40002 -1.04159 NA 0.40002 0.30196 0.49808
+#&gt; 7 microM 0.22802 0.39779 1.71015 NA 0.39779 0.29975 0.49582
+#&gt; 8 microM 0.23077 -0.37351 1.19152 NA 0.42315 0.31775 0.52855
+#&gt; EDx10 EDx10 2.5% EDx10 97.5%
+#&gt; 1 NA NA NA
+#&gt; 2 0.093074 0.040308 0.14584
+#&gt; 3 0.085338 0.035963 0.13471
+#&gt; 4 0.069958 0.026197 0.11372
+#&gt; 5 0.120238 0.043513 0.19696
+#&gt; 6 0.116878 0.048151 0.18561
+#&gt; 7 0.110068 0.043085 0.17705
+#&gt; 8 0.087066 0.017958 0.15617</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
diff --git a/docs/reference/drcfit.html b/docs/reference/drcfit.html
index ccf4641..75a168a 100644
--- a/docs/reference/drcfit.html
+++ b/docs/reference/drcfit.html
@@ -209,7 +209,16 @@
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='fu'>data</span>(<span class='no'>antifoul</span>)
<span class='no'>r</span> <span class='kw'>&lt;-</span> <span class='fu'>drcfit</span>(<span class='no'>antifoul</span>, <span class='kw'>showED50</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>EDx</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='fl'>5</span>, <span class='fl'>10</span>, <span class='fl'>20</span>))</div><div class='output co'>#&gt; <span class='message'></span>
-#&gt; <span class='message'>TBT: Fitting data...</span></div><div class='output co'>#&gt; <span class='error'>Error in ED50["1:50", "Lower"]: Indizierung außerhalb der Grenzen</span></div><div class='input'><span class='fu'>format</span>(<span class='no'>r</span>, <span class='kw'>digits</span> <span class='kw'>=</span> <span class='fl'>2</span>)</div><div class='output co'>#&gt; <span class='error'>Error in format(r, digits = 2): Objekt 'r' nicht gefunden</span></div></pre>
+#&gt; <span class='message'>TBT: Fitting data...</span></div><div class='output co'>#&gt; <span class='message'></span>
+#&gt; <span class='message'>Zn Pyrithion: Fitting data...</span></div><div class='input'><span class='fu'>format</span>(<span class='no'>r</span>, <span class='kw'>digits</span> <span class='kw'>=</span> <span class='fl'>2</span>)</div><div class='output co'>#&gt; Substance ndl n lld lhd mtype logED50 2.5% 97.5% unit sigma a
+#&gt; 1 TBT 38 135 -2.7 2.4 probit -0.16 -0.28 -0.072 microM 0.19 0.68
+#&gt; 2 Zn Pyrithion 27 81 -2.1 2.0 probit -0.40 -0.52 -0.303 microM 0.23 0.40
+#&gt; b ED50 ED50 2.5% ED50 97.5% EDx5 EDx5 2.5% EDx5 97.5% EDx10 EDx10 2.5%
+#&gt; 1 -0.64 0.68 0.52 0.85 0.053 0.015 0.091 0.093 0.040
+#&gt; 2 -1.04 0.40 0.30 0.50 0.082 0.023 0.142 0.117 0.048
+#&gt; EDx10 97.5% EDx20 EDx20 2.5% EDx20 97.5%
+#&gt; 1 0.15 0.18 0.11 0.26
+#&gt; 2 0.19 0.18 0.10 0.26</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
diff --git a/man/IM1xIPC81.Rd b/man/IM1xIPC81.Rd
index dda0c3b..5994f6a 100644
--- a/man/IM1xIPC81.Rd
+++ b/man/IM1xIPC81.Rd
@@ -29,7 +29,7 @@
print(rIM1xIPC81.drc,digits=4)
}
\source{
- Ranke J, Mölter K, Stock F, Bottin-Weber U, Poczobutt J,
+ Ranke J, Mölter K, Stock F, Bottin-Weber U, Poczobutt J,
Hoffmann J, Ondruschka B, Filser J, Jastorff B (2004)
Biological effects of imidazolium ionic liquids with varying
chain lenghts in acute Vibrio fischeri and WST-1 cell
diff --git a/man/IM1xVibrio.Rd b/man/IM1xVibrio.Rd
index cb0bd48..d3258fb 100644
--- a/man/IM1xVibrio.Rd
+++ b/man/IM1xVibrio.Rd
@@ -6,9 +6,9 @@
This is the raw data documenting the influence of the alkyl chain length in 3
position on the toxicity to the marine luminescent bacteria \emph{V.
fischeri}. The substances are named according to the UFT naming scheme of
- these substances.
- IM13 BF4 means 1-methyl-3-propylimidazolium tetrafluoroborate,
- IM14 BF4 means 1-methyl-3-butylimidazolium tetrafluoroborate and
+ these substances.
+ IM13 BF4 means 1-methyl-3-propylimidazolium tetrafluoroborate,
+ IM14 BF4 means 1-methyl-3-butylimidazolium tetrafluoroborate and
IM1-10 BF4 means 1-methyl-3-decylimidazolium tetrafluoroborate.
}
\usage{data(IM1xVibrio)}
@@ -28,7 +28,7 @@
print(rIM1xVibrio.drc, digits = 4)
}
\source{
- Ranke J, Mölter K, Stock F, Bottin-Weber U, Poczobutt J, Hoffmann J,
+ Ranke J, Mölter K, Stock F, Bottin-Weber U, Poczobutt J, Hoffmann J,
Ondruschka B, Filser J, Jastorff B (2004) Biological effects of imidazolium
ionic liquids with varying chain lenghts in acute Vibrio fischeri and WST-1
cell viability assays. Ecotoxicology and Environmental Safety 58(3) 396-404
diff --git a/man/XY.Rd b/man/XY.Rd
index 8022264..82a48fe 100644
--- a/man/XY.Rd
+++ b/man/XY.Rd
@@ -3,7 +3,7 @@
\alias{XY}
\title{Dose-Response data for two substances X and Y}
\description{
- This is just a sample Lemna growth rate data set for two substances
+ This is just a sample Lemna growth rate data set for two substances
arbitrarily named X and Y.
}
\usage{data(XY)}
diff --git a/man/antifoul.Rd b/man/antifoul.Rd
index 21ae885..e782636 100644
--- a/man/antifoul.Rd
+++ b/man/antifoul.Rd
@@ -3,9 +3,9 @@
\alias{antifoul}
\title{Dose-Response data for TBT and Zink Pyrithione in IPC-81 cells}
\description{
- This data set shows the response of the rat leukaemic cell line IPC-81 to
+ This data set shows the response of the rat leukaemic cell line IPC-81 to
dilution series of tributyltin chloride (TBT) and Zink Pyrithione as retrieved
- from the "cytotox" database of the UFT Department of Bioorganic Chemistry on
+ from the "cytotox" database of the UFT Department of Bioorganic Chemistry on
February 25, 2004
}
\usage{data(antifoul)}
@@ -15,15 +15,15 @@
database are also present.
}
\examples{
-rantifoul.ED50 <- drfit(antifoul,
+rantifoul.ED50 <- drfit(antifoul,
linlogit = TRUE, logit = TRUE, weibull = TRUE,
- chooseone = FALSE,
+ chooseone = FALSE,
showED50 = TRUE, EDx = c(10))
print(rantifoul.ED50, digits = 5)
-rantifoul.drc <- drcfit(antifoul,
+rantifoul.drc <- drcfit(antifoul,
linlogit = TRUE, logit = TRUE, weibull = TRUE,
- chooseone = FALSE,
+ chooseone = FALSE,
showED50 = TRUE, EDx = c(10))
print(rantifoul.drc, digits = 5)
}
diff --git a/man/checkcontrols.Rd b/man/checkcontrols.Rd
index b155643..3941a69 100644
--- a/man/checkcontrols.Rd
+++ b/man/checkcontrols.Rd
@@ -6,7 +6,7 @@
experiments from a specified database.
}
\usage{
- checkcontrols(last = 10, id = NULL, db = "cytotox", organism = "Vibrio fischeri",
+ checkcontrols(last = 10, id = NULL, db = "cytotox", organism = "Vibrio fischeri",
endpoint = "\%", qcc = c("R", "xbar"))
}
\arguments{
@@ -29,9 +29,9 @@
The endpoint that should be used for selecting the data. Only important if
the database "ecotox" is used. Defaults to "\%".}
\item{qcc}{
- The type of quality control charts to be plotted. By default, an R chart
- (showing ranges of control values within plates/experiments), and an
- xbar chart (showing means) are generated.
+ The type of quality control charts to be plotted. By default, an R chart
+ (showing ranges of control values within plates/experiments), and an
+ xbar chart (showing means) are generated.
}
}
\value{
@@ -41,8 +41,8 @@
\dontrun{checkcontrols(15)}
}
\author{
- Johannes Ranke
- \email{jranke@uni-bremen.de}
+ Johannes Ranke
+ \email{jranke@uni-bremen.de}
\url{http://www.uft.uni-bremen.de/chemie/ranke}
}
\keyword{database}
diff --git a/man/checkexperiment.Rd b/man/checkexperiment.Rd
index 0edf2fb..6a682fa 100644
--- a/man/checkexperiment.Rd
+++ b/man/checkexperiment.Rd
@@ -29,8 +29,8 @@
\dontrun{checkplate(3)}
}
\author{
- Johannes Ranke
- \email{jranke@uni-bremen.de}
+ Johannes Ranke
+ \email{jranke@uni-bremen.de}
\url{http://www.uft.uni-bremen.de/chemie/ranke}
}
\keyword{database}
diff --git a/man/checksubstance.Rd b/man/checksubstance.Rd
index 387785f..6182fce 100644
--- a/man/checksubstance.Rd
+++ b/man/checksubstance.Rd
@@ -6,8 +6,8 @@
the data.
}
\usage{
- checksubstance(substance, db = "cytotox", experimentator = "\%",
- celltype = "\%", enzymetype = "\%", organism = "\%",
+ checksubstance(substance, db = "cytotox", experimentator = "\%",
+ celltype = "\%", enzymetype = "\%", organism = "\%",
endpoint = "\%",
whereClause = "1", ok = "\%")
}
@@ -17,7 +17,7 @@
\item{db}{
The database to be used. Currently, the databases "cytotox" and "enzymes"
of the UFT Department of Bioorganic Chemistry are supported (default is
- "cytotox").}
+ "cytotox").}
\item{experimentator}{
The name of the experimentator whose data is to be used. Default is "\%",
which means that data from all experimentators are shown.}
@@ -35,10 +35,10 @@
The endpoint that should be used for selecting the data. Only important if
the database "ecotox" is used. Defaults to "\%".}
\item{whereClause}{
- With this argument, additional conditions for the SQL query can be set,
+ With this argument, additional conditions for the SQL query can be set,
e.g. "plate != 710". The default is 1 (in SQL syntax this means TRUE).}
\item{ok}{
- With the default value "\%", all data in the database is retrieved for the
+ With the default value "\%", all data in the database is retrieved for the
specified substance.}
}
\value{
@@ -49,8 +49,8 @@
\dontrun{checksubstance("IM14 BF4")}
}
\author{
- Johannes Ranke
- \email{jranke@uni-bremen.de}
+ Johannes Ranke
+ \email{jranke@uni-bremen.de}
\url{http://www.uft.uni-bremen.de/chemie/ranke}
}
\keyword{database}
diff --git a/man/drcfit.Rd b/man/drcfit.Rd
index b10418a..67462ba 100644
--- a/man/drcfit.Rd
+++ b/man/drcfit.Rd
@@ -7,7 +7,7 @@
}
\usage{
drcfit(data, chooseone = TRUE, probit = TRUE, logit = FALSE,
- weibull = FALSE, linlogit = FALSE, level = 0.95,
+ weibull = FALSE, linlogit = FALSE, level = 0.95,
showED50 = FALSE, EDx = NULL)
}
\arguments{
@@ -67,7 +67,7 @@
\value{
A dataframe with the attribute \code{models} holding a list of the fitted
dose-response models of class \code{\link{nls}}. The dataframe has at least
- one line for each substance.
+ one line for each substance.
The following variables are in the dataframe:
\item{Substance}{
@@ -89,14 +89,14 @@
If the data did not show a mean response < 0.5 at the highest dose level,
the modeltype is set to \dQuote{inactive}. If the mean response at the
lowest dose is smaller than 0.5, the modeltype is set to \dQuote{active}.
- In both cases, no fitting procedure is carried out. If the fitted ED50
+ In both cases, no fitting procedure is carried out. If the fitted ED50
is higher than the highest dose, \dQuote{no fit} is given here.
}
\item{logED50}{
The decadic logarithm of the ED50
}
\item{low \%}{
- The lower bound of the confidence interval of log ED50.
+ The lower bound of the confidence interval of log ED50.
The name of the column depends on the requested confidence \code{level}.
}
\item{high \%}{
@@ -112,16 +112,16 @@
}
\item{a}{
For the linlogit model, this is the parameter e from \code{\link{BC.4}}.
- For the probit and the logit model, this is the ED50. For the weibull
- model, this is parameter e from \code{\link{W1.2}}. Note that the Weibull
+ For the probit and the logit model, this is the ED50. For the weibull
+ model, this is parameter e from \code{\link{W1.2}}. Note that the Weibull
model is fitted to the untransformed data.
}
\item{b}{
For the linlogit, probit, logit and weibull models, these are the
- parameters b from \code{\link{BC.4}}, \code{\link{LN.2}},
+ parameters b from \code{\link{BC.4}}, \code{\link{LN.2}},
\code{\link{LL.2}} and \code{\link{W1.2}}, respectively.
Note that the parameter definitions (and in the case of Weibull, the model
- used) are different to the ones used in \code{\link{drfit}}.
+ used) are different to the ones used in \code{\link{drfit}}.
}
\item{c}{
Only the \dQuote{linlogit} fit produces a third parameter \code{c}, which is
@@ -140,14 +140,14 @@ r <- drcfit(antifoul, showED50 = TRUE, EDx = c(5, 10, 20))
format(r, digits = 2)
}
\note{There is a demo for each dataset that can be accessed by
- \code{demo(dataset)}}
+ \code{demo(dataset)}}
\seealso{
Further examples are given in help pages to the datasets
\code{\link{antifoul}}, \code{\link{IM1xIPC81}} and
\code{\link{IM1xVibrio}}.
}
\author{
- Johannes Ranke \email{jranke@uni-bremen.de}
+ Johannes Ranke \email{jranke@uni-bremen.de}
\url{http://www.uft.uni-bremen.de/chemie/ranke}
The functionality of the drc package used under the hood in this function
was written by Christian Ritz.
diff --git a/man/drdata.Rd b/man/drdata.Rd
index 8f545da..4fb6740 100644
--- a/man/drdata.Rd
+++ b/man/drdata.Rd
@@ -2,11 +2,11 @@
\alias{drdata}
\title{Get dose-response data via RODBC}
\description{
- Get dose-response data from an adequate ODBC data source
+ Get dose-response data from an adequate ODBC data source
}
\usage{
- drdata(substances, experimentator = "\%", db = "cytotox", celltype = "IPC-81",
- enzymetype="AChE", organism="Vibrio fischeri", endpoint="Luminescence",
+ drdata(substances, experimentator = "\%", db = "cytotox", celltype = "IPC-81",
+ enzymetype="AChE", organism="Vibrio fischeri", endpoint="Luminescence",
whereClause = "1", ok = "'ok','no fit'")
}
\arguments{
@@ -18,11 +18,11 @@
which means that data from all experimentators are retrieved.}
\item{db}{
The database to be used. Currently, the databases "cytotox", "enzymes"
- and "ecotox" of the UFT Department of Bioorganic Chemistry are
- supported (default is "cytotox").}
+ and "ecotox" of the UFT Department of Bioorganic Chemistry are
+ supported (default is "cytotox").}
\item{celltype}{
Currently, only data for IPC-81, C6, NB4, HeLa, Jurkat and U937 are
- supported.}
+ supported.}
\item{enzymetype}{
Currently, only data for AChE, GR and GST are supported.}
\item{organism}{
@@ -32,9 +32,9 @@
The endpoint that should be used for selecting the data. Only important if
the database "ecotox" is used. Defaults to "Luminescence".}
\item{whereClause}{
- With this argument, additional conditions for the SQL query can be set,
+ With this argument, additional conditions for the SQL query can be set,
e.g. "plate != 710" (i.e. "Do not retrieve data for plate 710"). The
- default is 1 (in SQL syntax this means TRUE).}
+ default is 1 (in SQL syntax this means TRUE).}
\item{ok}{
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"
@@ -58,7 +58,7 @@
myODBC. Then, under Unix, you can use iodbc or unixodbc for setting up the
respective data source with data source name (DSN) "cytotox". For my
setting using unixodbc, I am using the file \file{/etc/odbcinst.ini}
- containing:
+ containing:
\tabular{lll}{
[MySQL] \tab \tab \cr
Description \tab = \tab MySQL driver for ODBC \cr
@@ -83,8 +83,8 @@
\dontrun{drdata(c("TBT","ZnPT2"))}
}
\author{
- Johannes Ranke
- \email{jranke@uni-bremen.de}
+ Johannes Ranke
+ \email{jranke@uni-bremen.de}
\url{http://www.uft.uni-bremen.de/chemie/ranke}
}
\keyword{IO}
diff --git a/man/drfit-package.Rd b/man/drfit-package.Rd
index 696cee9..06a147f 100644
--- a/man/drfit-package.Rd
+++ b/man/drfit-package.Rd
@@ -16,7 +16,7 @@ of R for chemists.
Author and Maintainer: Johannes Ranke <jranke@uni-bremen.de>
}
\note{There is a demo for each dataset that can be accessed by
- \code{demo(dataset)}}
+ \code{demo(dataset)}}
\keyword{ package }
\keyword{ models }
\keyword{ regression }
diff --git a/man/drfit.Rd b/man/drfit.Rd
index 3729550..ec7fa70 100644
--- a/man/drfit.Rd
+++ b/man/drfit.Rd
@@ -9,7 +9,7 @@
drfit(data, startlogED50 = NA, chooseone = TRUE, probit = TRUE, logit = FALSE,
weibull = FALSE, linlogit = FALSE, level = 0.95, linlogitWrong = NA,
allWrong = NA, ps0 = 1, ls0 = 0.5, ws0 = 0.5, b0 = 2, f0 = 0,
- showED50 = FALSE,
+ showED50 = FALSE,
EDx = NULL, EDx.tolerance = 1e-4)
}
\arguments{
@@ -32,11 +32,11 @@
\item{probit}{
A boolean defining if cumulative density curves of normal distributions
\code{\link{pnorm}} are fitted against the decadic logarithm of the dose.
- Default ist TRUE.}
+ Default ist TRUE.}
\item{logit}{
A boolean defining if cumulative density curves of logistic distributions
\code{\link{plogis}} are fitted to the decadic logarithm of the dose.
- Default is FALSE.}
+ Default is FALSE.}
\item{weibull}{
A boolean defining if the cumulative density curves of weibull distributions
(\code{\link{pweibull}} with additionall location parameter and scale=1)
@@ -87,14 +87,14 @@
\value{
A dataframe with the attribute \code{models} holding a list of the fitted
dose-response models of class \code{\link{nls}}. The dataframe has at least
- one line for each substance.
+ one line for each substance.
For the \dQuote{linlogit}, \dQuote{logit} and \dQuote{probit} models, the
parameter \code{a} that is reported coincides with the logED50, i.e the
logED50 is one of the model parameters that is being fitted. Therefore,
a confidence interval for the confidence level \code{level} is calculated
using the \code{\link[MASS:confint]{confint.nls}} function and listed.
-
+
The following variables are in the dataframe:
\item{Substance}{
The name of the substance
@@ -115,14 +115,14 @@
If the data did not show a mean response < 0.5 at the highest dose level,
the modeltype is set to \dQuote{inactive}. If the mean response at the
lowest dose is smaller than 0.5, the modeltype is set to \dQuote{active}.
- In both cases, no fitting procedure is carried out. If the fitted ED50
+ In both cases, no fitting procedure is carried out. If the fitted ED50
is higher than the highest dose, \dQuote{no fit} is given here.
}
\item{logED50}{
The decadic logarithm of the ED50
}
\item{low \%}{
- The lower bound of the confidence interval of log ED50.
+ The lower bound of the confidence interval of log ED50.
The name of the column depends on the requested confidence \code{level}.
}
\item{high \%}{
@@ -139,7 +139,7 @@
\item{a}{
For the \dQuote{linlogit}, \dQuote{logit} and \dQuote{probit} models, the
parameter \code{a} coincides with the logED50. In the case of the
- \dQuote{weibull} model, \code{a} is a location parameter.
+ \dQuote{weibull} model, \code{a} is a location parameter.
}
\item{b}{
Parameter \code{b} in the case of the \dQuote{linlogit} fit is the variable
@@ -165,7 +165,7 @@ r <- drfit(antifoul, showED50 = TRUE, EDx = c(5, 10, 20))
format(r, digits = 2)
}
\note{There is a demo for each dataset that can be accessed by
- \code{demo(dataset)}}
+ \code{demo(dataset)}}
\seealso{
Further examples are given in help pages to the datasets
\code{\link{antifoul}}, \code{\link{IM1xIPC81}} and
@@ -175,8 +175,8 @@ format(r, digits = 2)
confidence intervals for EDx values via this package.
}
\author{
- Johannes Ranke
- \email{jranke@uni-bremen.de}
+ Johannes Ranke
+ \email{jranke@uni-bremen.de}
\url{http://www.uft.uni-bremen.de/chemie/ranke}
}
\keyword{models}
diff --git a/man/drplot.Rd b/man/drplot.Rd
index e9e4dd1..6b8a7bf 100644
--- a/man/drplot.Rd
+++ b/man/drplot.Rd
@@ -2,7 +2,7 @@
\alias{drplot}
\title{Plot dose-response models}
\description{
- Produce graphics of dose-response data and dose-response relationships
+ Produce graphics of dose-response data and dose-response relationships
either combined or separately, for one or more substances.
}
\usage{
@@ -14,13 +14,13 @@
\item{drresults}{
A data frame as returned from \code{\link{drfit}}.
}
- \item{data}{
+ \item{data}{
A data frame as returned from \code{\link{drdata}}. The data frame has to
contain at least a factor called "substance", a vector called "unit"
containing the unit used for the dose, a column "response" with the
response values of the test system normalized between 0 and 1, a column
"dose" with the numeric dose values and a factor called "dosefactor"
- containing the dose as a factor.
+ containing the dose as a factor.
}
\item{dtype}{
A string describing if the raw data should be plotted ("raw"), or an error
@@ -33,7 +33,7 @@
chosen.
}
\item{ctype}{
- This argument decides if horizontal lines are drawn to show the scatter of
+ This argument decides if horizontal lines are drawn to show the scatter of
the control values (dose = 0), if there are more than three of them.
Defaults to "none", further allowed values are "std" and "conf" for
displaying the standard deviation of the controls or the confidence
@@ -49,7 +49,7 @@
}
\item{overlay}{
If TRUE, all output will be put into one graph, otherwise a separate graph
- will be created for each substance.
+ will be created for each substance.
}
\item{xlim}{
The plot limits (min,max) on the dose axis.
@@ -72,12 +72,12 @@
\code{\link{plot.default}}
}
\item{postscript}{
- If TRUE, (a) postscript graph(s) will be created. Otherwise, and if
+ If TRUE, (a) postscript graph(s) will be created. Otherwise, and if
the pdf and png arguments are also FALSE, graphics will be
displayed with a screen graphics device.
}
\item{pdf}{
- If TRUE, (a) pdf graph(s) will be created. Otherwise, and if
+ If TRUE, (a) pdf graph(s) will be created. Otherwise, and if
the postscript, and png arguments are also FALSE, graphics will be
displayed with a screen graphics device.
}
@@ -87,7 +87,7 @@
with a screen graphics device.
}
\item{bw}{
- A boolean deciding if the plots will be black and white or not. Default
+ A boolean deciding if the plots will be black and white or not. Default
is TRUE.
}
\item{pointsize}{
@@ -107,7 +107,7 @@
\item{lpos}{
An optional argument defaulting to "topright" specifying the position
of the legend by being passed to the legend function. See the help for the
- legend function for all possiblities.}
+ legend function for all possiblities.}
\item{devoff}{
If set to FALSE, the device will not be closed after creation of an overlay
pdf, png or postscript graph, so texts and other elements can
@@ -119,17 +119,17 @@
You will get plots of data and/or the fitted dose-response curves, on the
screen and/or as postscript/pdf/png files, depending on the parameters.
}
-}
+}
\examples{
data(antifoul)
r <- drfit(antifoul)
\dontrun{drplot(r,antifoul)}
}
\note{There is a demo for each dataset that can be accessed by
- \code{demo(dataset)}}
+ \code{demo(dataset)}}
\author{
- Johannes Ranke
- \email{jranke@uni-bremen.de}
+ Johannes Ranke
+ \email{jranke@uni-bremen.de}
\url{http://www.uft.uni-bremen.de/chemie/ranke}
}
\keyword{models}
diff --git a/man/linlogitf.Rd b/man/linlogitf.Rd
index f091581..2c9ddc4 100755..100644
--- a/man/linlogitf.Rd
+++ b/man/linlogitf.Rd
@@ -22,13 +22,13 @@
}
\value{
The response at dose x.
-}
+}
\references{
van Ewijk, P. H. and Hoekstra, J. A. (1993) \emph{Ecotox Environ Safety}
\bold{25} 25-32}
\author{
- Johannes Ranke
- \email{jranke@uni-bremen.de}
+ Johannes Ranke
+ \email{jranke@uni-bremen.de}
\url{http://www.uft.uni-bremen.de/chemie/ranke}
}
\keyword{models}
diff --git a/tests/IM1xIPC81.Rout.save b/tests/IM1xIPC81.Rout.save
index 3ed2681..b77f900 100644
--- a/tests/IM1xIPC81.Rout.save
+++ b/tests/IM1xIPC81.Rout.save
@@ -1,6 +1,6 @@
-R version 3.1.1 (2014-07-10) -- "Sock it to Me"
-Copyright (C) 2014 The R Foundation for Statistical Computing
+R version 3.3.3 (2017-03-06) -- "Another Canoe"
+Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
@@ -24,12 +24,6 @@ IM13 BF4: Fitting data...
IM14 BF4: Fitting data...
-Error in nls(response ~ linlogitf(dose, 1, f, logED50, b), data = tmp, :
- Convergence failure: false convergence (8)
-Error in numericDeriv(form[[3L]], names(ind), env, ifelse(internalPars < :
- Missing value or an infinity produced when evaluating the model
-In addition: Warning message:
-In pnorm(-log10(dose), -logED50, scale) : NaNs produced
IM15 BF4: Fitting data...
@@ -40,30 +34,23 @@ IM16 BF4: Fitting data...
IM17 BF4: Fitting data...
Waiting for profiling to be done...
-Error in numericDeriv(form[[3L]], names(ind), env, ifelse(internalPars < :
- Missing value or an infinity produced when evaluating the model
-In addition: Warning message:
-In pnorm(-log10(dose), -logED50, scale) : NaNs produced
IM18 BF4: Fitting data...
Waiting for profiling to be done...
-Error in numericDeriv(form[[3L]], names(ind), env, ifelse(internalPars < :
- Missing value or an infinity produced when evaluating the model
-In addition: Warning message:
-In pnorm(-log10(dose), -logED50, scale) : NaNs produced
IM19 BF4: Fitting data...
Waiting for profiling to be done...
-Error in numericDeriv(form[[3L]], names(ind), env, ifelse(internalPars < :
- Missing value or an infinity produced when evaluating the model
-In addition: Warning message:
-In pnorm(-log10(dose), -logED50, scale) : NaNs produced
IM1-10 BF4: Fitting data...
Waiting for profiling to be done...
+Warning messages:
+1: In pnorm(-log10(dose), -logED50, scale) : NaNs produced
+2: In pnorm(-log10(dose), -logED50, scale) : NaNs produced
+3: In pnorm(-log10(dose), -logED50, scale) : NaNs produced
+4: In pnorm(-log10(dose), -logED50, scale) : NaNs produced
> print(rIM1xIPC81,digits=4)
Substance ndl n lld lhd mtype logED50 2.5% 97.5% unit sigma
1 IM13 BF4 9 81 0.5918 3.000 inactive NA NA NA microM NA
@@ -86,4 +73,4 @@ Waiting for profiling to be done...
>
> proc.time()
user system elapsed
- 1.111 0.808 0.789
+ 1.600 0.676 1.525
diff --git a/tests/pyrithione.Rout.save b/tests/pyrithione.Rout.save
index f796a40..1c899f3 100644
--- a/tests/pyrithione.Rout.save
+++ b/tests/pyrithione.Rout.save
@@ -1,6 +1,6 @@
-R version 3.1.1 (2014-07-10) -- "Sock it to Me"
-Copyright (C) 2014 The R Foundation for Statistical Computing
+R version 3.3.3 (2017-03-06) -- "Another Canoe"
+Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
@@ -28,8 +28,6 @@ Pyridin: Fitting data...
PyNO: Fitting data...
-Error in nls(response ~ linlogitf(dose, 1, f, logED50, b), data = tmp, :
- Convergence failure: false convergence (8)
(PT)2: Fitting data...
@@ -45,10 +43,6 @@ Waiting for profiling to be done...
PyS: Fitting data...
Waiting for profiling to be done...
-Error in numericDeriv(form[[3L]], names(ind), env, ifelse(internalPars < :
- Missing value or an infinity produced when evaluating the model
-In addition: Warning message:
-In pnorm(-log10(dose), -logED50, scale) : NaNs produced
Zn Pyrithion: Fitting data...
@@ -72,6 +66,8 @@ Waiting for profiling to be done...
NaJ: Fitting data...
+Warning message:
+In pnorm(-log10(dose), -logED50, scale) : NaNs produced
> print(rpyr,digits=2)
Substance ndl n lld lhd mtype logED50 2.5% 97.5% unit sigma
1 Na Pyrithion 20 108 -2.11 2.0 linlogit -0.35 -0.43 -0.26 microM 0.21
@@ -104,4 +100,4 @@ NaJ: Fitting data...
>
> proc.time()
user system elapsed
- 2.302 1.804 1.550
+ 1.884 0.680 1.831

Contact - Imprint