From 6d220f8d71564a0430473ab2465e169adddb02d8 Mon Sep 17 00:00:00 2001 From: ranke Date: Fri, 28 Apr 2006 11:42:14 +0000 Subject: - Fixed the drplot function, so the graphics parameter ask is adequately set depending on the overlay argument, and set back to the previous value - Added a test for each datase - Added a demo for each dataset - Corrected many small bugs in the documentation and improved formatting of the .Rd files git-svn-id: http://kriemhild.uft.uni-bremen.de/svn/drfit@74 d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc --- DESCRIPTION | 4 +-- R/drplot.R | 9 +++-- demo/00Index | 5 +++ demo/IM1xIPC81.R | 6 ++++ demo/IM1xVibrio.R | 6 ++++ demo/XY.R | 6 ++++ demo/antifoul.R | 5 +++ demo/pyrithione.R | 12 +++++++ man/IM1xIPC81.Rd | 3 ++ man/IM1xVibrio.Rd | 3 ++ man/XY.Rd | 3 ++ man/antifoul.Rd | 3 ++ man/checkexperiment.Rd | 4 +-- man/checksubstance.Rd | 12 ++++--- man/drdata.Rd | 46 +++++++++++++------------ man/drfit-package.Rd | 8 +++-- man/drfit.Rd | 2 ++ man/drplot.Rd | 22 +++++------- man/pyrithione.Rd | 3 ++ tests/IM1xIPC81.R | 4 +++ tests/IM1xIPC81.Rout.save | 75 ++++++++++++++++++++++++++++++++++++++++ tests/IM1xVibrio.R | 4 +++ tests/IM1xVibrio.Rout.save | 57 +++++++++++++++++++++++++++++++ tests/XY.R | 4 +++ tests/XY.Rout.save | 37 ++++++++++++++++++++ tests/antifoul.R | 4 +++ tests/antifoul.Rout.save | 33 ++++++++++++++++++ tests/pyrithione.R | 4 +++ tests/pyrithione.Rout.save | 85 ++++++++++++++++++++++++++++++++++++++++++++++ 29 files changed, 419 insertions(+), 50 deletions(-) create mode 100644 demo/00Index create mode 100644 demo/IM1xIPC81.R create mode 100644 demo/IM1xVibrio.R create mode 100644 demo/XY.R create mode 100644 demo/antifoul.R create mode 100644 demo/pyrithione.R create mode 100644 tests/IM1xIPC81.R create mode 100644 tests/IM1xIPC81.Rout.save create mode 100644 tests/IM1xVibrio.R create mode 100644 tests/IM1xVibrio.Rout.save create mode 100644 tests/XY.R create mode 100644 tests/XY.Rout.save create mode 100644 tests/antifoul.R create mode 100644 tests/antifoul.Rout.save create mode 100644 tests/pyrithione.R create mode 100644 tests/pyrithione.Rout.save diff --git a/DESCRIPTION b/DESCRIPTION index f2aee98..b860b9b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: drfit -Version: 0.05-73 -Date: 2006-04-26 +Version: 0.05-74 +Date: 2006-04-28 Title: Dose-response data evaluation Author: Johannes Ranke Maintainer: Johannes Ranke diff --git a/R/drplot.R b/R/drplot.R index eaae85b..e690653 100644 --- a/R/drplot.R +++ b/R/drplot.R @@ -7,6 +7,7 @@ drplot <- function(drresults, data, pointsize = 12, colors = 1:8, devoff=T, lpos="topright") { + op <- par(no.readonly = TRUE) # Check if all data have the same unit unitlevels <- levels(as.factor(drresults$unit)) if (length(unitlevels) == 1) { @@ -85,9 +86,9 @@ drplot <- function(drresults, data, ylab = "Normalized response") } else { # If overlay plot is not requested, ask before showing multiple plots on the screen - if (!postscript && !png && !pdf) { - par(ask=TRUE) - } + if (!postscript && !png && !pdf && length(dsubstances) > 1) { + op <- par(ask=TRUE) + } } # Plot the data either as raw data or as error bars @@ -219,4 +220,6 @@ drplot <- function(drresults, data, dev.off() } } + # Reset the ask parameter to previous setting + par(op) } diff --git a/demo/00Index b/demo/00Index new file mode 100644 index 0000000..45b0319 --- /dev/null +++ b/demo/00Index @@ -0,0 +1,5 @@ +IM1xIPC81 Analysis of chain methylimidazolium chain length cytotox data +IM1xVibrio Analysis of chain methylimidazolium chain length V. fischeri data +XY Analysis of the sample Lemna data called XY +antifoul Analysis of the cytotoxicity data for TBT and ZnPT +pyrithione Analysis of the cytotoxicity of pyrithione and related species diff --git a/demo/IM1xIPC81.R b/demo/IM1xIPC81.R new file mode 100644 index 0000000..2615a7e --- /dev/null +++ b/demo/IM1xIPC81.R @@ -0,0 +1,6 @@ +require(drfit) +data(IM1xIPC81) +rIM1xIPC81 <- drfit(IM1xIPC81,linlogit=TRUE) +rIM1xIPC81 +drplot(rIM1xIPC81,IM1xIPC81, + overlay=TRUE,bw=FALSE,xlim=c("auto",5.5)) diff --git a/demo/IM1xVibrio.R b/demo/IM1xVibrio.R new file mode 100644 index 0000000..b92a08d --- /dev/null +++ b/demo/IM1xVibrio.R @@ -0,0 +1,6 @@ +require(drfit) +data(IM1xVibrio) +rIM1xVibrio <- drfit(IM1xVibrio) +rIM1xVibrio +drplot(rIM1xVibrio,IM1xVibrio, + overlay=TRUE,bw=FALSE,lpos="bottomleft") diff --git a/demo/XY.R b/demo/XY.R new file mode 100644 index 0000000..04a4c5e --- /dev/null +++ b/demo/XY.R @@ -0,0 +1,6 @@ +require(drfit) +data(XY) +rXY <- drfit(XY) +rXY +drplot(rXY,XY,dtype="raw", + overlay=TRUE,bw=FALSE) diff --git a/demo/antifoul.R b/demo/antifoul.R new file mode 100644 index 0000000..be63bff --- /dev/null +++ b/demo/antifoul.R @@ -0,0 +1,5 @@ +require(drfit) +data(antifoul) +rantifoul <- drfit(antifoul) +rantifoul +drplot(rantifoul,antifoul,overlay=TRUE,bw=FALSE) diff --git a/demo/pyrithione.R b/demo/pyrithione.R new file mode 100644 index 0000000..5b5a75d --- /dev/null +++ b/demo/pyrithione.R @@ -0,0 +1,12 @@ +require(drfit) +data(pyrithione) + +# MSPT and MSPHI give unreasonable fits with the linlogit model +rpyr <- drfit(pyrithione,linlogit=TRUE,linlogitWrong=c("MSPT","MSPHI")) +rpyr + +# Consult the above result list to sort out the colors +drplot(rpyr,pyrithione,dtype="none",overlay=TRUE,bw=FALSE, + colors=rainbow(14),xlim=c("auto",8)) + +drplot(rpyr,pyrithione) diff --git a/man/IM1xIPC81.Rd b/man/IM1xIPC81.Rd index 40aaa81..4f5a1dd 100644 --- a/man/IM1xIPC81.Rd +++ b/man/IM1xIPC81.Rd @@ -20,6 +20,9 @@ \code{\link{drfit}} function. An additional column contains the tested organism (name of the cell line). } +\examples{ + \dontrun{demo(IM1xIPC81)} +} \source{ Ranke J, M闤ter K, Stock F, Bottin-Weber U, Poczobutt J, Hoffmann J, Ondruschka B, Filser J, Jastorff B (2004) diff --git a/man/IM1xVibrio.Rd b/man/IM1xVibrio.Rd index 454e099..5315432 100644 --- a/man/IM1xVibrio.Rd +++ b/man/IM1xVibrio.Rd @@ -18,6 +18,9 @@ Vibrio fischeri, \code{organism}), and a field specifying if the data is regarded valid (\code{ok}). } +\examples{ + \dontrun{demo(IM1xVibrio)} +} \source{ Ranke J, M闤ter K, Stock F, Bottin-Weber U, Poczobutt J, Hoffmann J, Ondruschka B, Filser J, Jastorff B (2004) Biological effects of imidazolium diff --git a/man/XY.Rd b/man/XY.Rd index ab304ba..8022264 100644 --- a/man/XY.Rd +++ b/man/XY.Rd @@ -11,6 +11,9 @@ A dataframe containing dose (concentration) and response data, as well as control values where the dose is zero. } +\examples{ + \dontrun{demo(XY)} +} \source{ \url{http://www.uft.uni-bremen.de/chemie} } diff --git a/man/antifoul.Rd b/man/antifoul.Rd index bebec41..2aa532e 100644 --- a/man/antifoul.Rd +++ b/man/antifoul.Rd @@ -14,6 +14,9 @@ for TBT and Zink Pyrithione, respectively. Some additional columns from the database are also present. } +\examples{ + \dontrun{demo(antifoul)} +} \source{ \url{http://www.uft.uni-bremen.de/chemie} } diff --git a/man/checkexperiment.Rd b/man/checkexperiment.Rd index d68cd87..56db90c 100644 --- a/man/checkexperiment.Rd +++ b/man/checkexperiment.Rd @@ -22,8 +22,8 @@ The function lists a report and shows two graphs side by side. } \examples{ -# Check plate number 1 in the cytotox database -\dontrun{data <- checkplate(3)} +# Check plate number 3 in the cytotox database +\dontrun{checkplate(3)} } \author{ Johannes Ranke diff --git a/man/checksubstance.Rd b/man/checksubstance.Rd index 59759e8..f5340fe 100644 --- a/man/checksubstance.Rd +++ b/man/checksubstance.Rd @@ -16,13 +16,15 @@ of the UFT Department of Bioorganic Chemistry are supported (default is "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.} + The name of the experimentator whose data is to be used. Default is "\%", + which means that data from all experimentators are shown.} \item{celltype}{ - Currently, only data for IPC-81, C6, NB4, HeLa, Jurkat and U937 are supported. - Default is "\%", i.e. data for any cell type will be displayed.} + Currently, only data for IPC-81, C6, NB4, HeLa, Jurkat and U937 are + supported. Default is "\%", i.e. data for any cell type will be + displayed.} \item{enzymetype}{ - Currently, only data for AChE, GR and GST are supported. The default value is "\%", i.e. data for any enzyme type will be displayed.} + Currently, only data for AChE, GR and GST are supported. The default value + is "\%", i.e. data for any enzyme type will be displayed.} \item{whereClause}{ 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).} diff --git a/man/drdata.Rd b/man/drdata.Rd index 0c1e901..8f545da 100644 --- a/man/drdata.Rd +++ b/man/drdata.Rd @@ -1,8 +1,8 @@ \name{drdata} \alias{drdata} -\title{Get dose-response data} +\title{Get dose-response data via RODBC} \description{ - Get dose-response data from a remote mysql server + Get dose-response data from an adequate ODBC data source } \usage{ drdata(substances, experimentator = "\%", db = "cytotox", celltype = "IPC-81", @@ -14,39 +14,40 @@ A string or an array of strings with the substance names for which dose-response data is to be retrieved.} \item{experimentator}{ - The name of the experimentator whose data is to be used. Default is "%", which - means that data from all experimentators are retrieved.} + The name of the experimentator whose data is to be used. Default is "%", + which means that data from all experimentators are retrieved.} \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").} + The database to be used. Currently, the databases "cytotox", "enzymes" + 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.} + Currently, only data for IPC-81, C6, NB4, HeLa, Jurkat and U937 are + supported.} \item{enzymetype}{ Currently, only data for AChE, GR and GST are supported.} \item{organism}{ The organism that was exposed to the chemical. Only important if the database "ecotox" is used. Defaults to "Vibrio fischeri".} \item{endpoint}{ - The endpoint that should be used for selecting the data. Only important if the - database "ecotox" is used. Defaults to "Vibrio fischeri".} + 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, e.g. "plate != 710" (i.e. "Do not retrieve data for plate 710"). The 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" 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.} + 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" + 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}{ - A data frame with a factor describing the dose levels, the numeric dose levels - and a numeric column describing the response, as well as the entries for - plate, experimentator, performed (date of test performance), celltype, unit - (of the dose/concentration), and for the ok field in the database.} + A data frame with a factor describing the dose levels, the numeric dose + levels and a numeric column describing the response, as well as the entries + for plate, experimentator, performed (date of test performance), celltype, + unit (of the dose/concentration), and for the ok field in the database.} } \details{ The function is currently only used for retrieving data from the @@ -74,11 +75,12 @@ Database \tab = \tab cytotox \cr Server \tab = \tab eckehaat \cr Port \tab = \tab 3306 \cr - }. + } } \examples{ -# Get cytotoxicity data for Tributyltin and zinc pyrithione, tested with IPC-81 cells -\dontrun{data <- drdata(c("TBT","ZnPT2"))} +# Get cytotoxicity data for Tributyltin and zinc pyrithione, tested with IPC-81 +# cells +\dontrun{drdata(c("TBT","ZnPT2"))} } \author{ Johannes Ranke diff --git a/man/drfit-package.Rd b/man/drfit-package.Rd index d98e10e..43334ff 100644 --- a/man/drfit-package.Rd +++ b/man/drfit-package.Rd @@ -13,14 +13,16 @@ There is a preliminary version of an introductory article located in \url{../doc \author{ Author and Maintainer: Johannes Ranke } +\note{There is a demo for each dataset that can be accessed by + \code{demo(dataset)}} \keyword{ package } \keyword{ models } \keyword{ regression } \keyword{ nonlinear } \seealso{ -There is another, more statistically sophisticated package with similar -functionality called \code{\link[drc:drc-package]{drc}}. I think my package is -more user-friendly, though. +On CRAN, there is another, more statistically sophisticated package with +similar functionality called \code{\link[drc:drc-package]{drc}}. I think +the advantage of my package is its user-friendliness. } \examples{ data(antifoul) diff --git a/man/drfit.Rd b/man/drfit.Rd index 9eb5476..a89b5dd 100644 --- a/man/drfit.Rd +++ b/man/drfit.Rd @@ -100,6 +100,8 @@ data(antifoul) r <- drfit(antifoul) format(r,digits=2) } +\note{There is a demo for each dataset that can be accessed by + \code{demo(dataset)}} \author{ Johannes Ranke \email{jranke@uni-bremen.de} diff --git a/man/drplot.Rd b/man/drplot.Rd index f8f8aa8..bff2388 100644 --- a/man/drplot.Rd +++ b/man/drplot.Rd @@ -49,9 +49,7 @@ } \item{overlay}{ If TRUE, all output will be put into one graph, otherwise a separate graph - will be created for each substance. In the latter case, on-screen display - (postscript=FALSE) only works correctly for data plots. Dose-response models - will all be put into the last graph in this case. + will be created for each substance. } \item{xlim}{ The plot limits (min,max) on the dose axis. @@ -66,7 +64,7 @@ } \item{pdf}{ If TRUE, (a) pdf graph(s) will be created. Otherwise, and if - the postscript and png arguments are also FALSE, graphics will be + the postscript, and png arguments are also FALSE, graphics will be displayed with a screen graphics device. } \item{png}{ @@ -79,7 +77,7 @@ is TRUE. } \item{pointsize}{ - The pointsize used for png and postscript graphics. + The pointsize used for pdf, png and postscript graphics. } \item{colors}{ This is a vector of colors, defaulting to 1:8, used for plotting the data. @@ -89,26 +87,24 @@ of the legend by being passed to the legend function. See the help for the legend function for all possiblities.} \item{devoff}{ - If set to FALSE, the closing of the device after creation of an overlay png - or postscript graph will be left out, so texts and other elements can be - added to the graph. + 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 + be added. } } \value{ \item{results}{ You will get plots of data and/or the fitted dose-response curves, on the - screen and/or as postscript files, depending on the parameters. + screen and/or as postscript/pdf/png files, depending on the parameters. } } -\note{ - Be sure all devices are closed (e.g. by calling \code{dev.off()}) before - calling \code{drplot} again after a failure. -} \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)}} \author{ Johannes Ranke \email{jranke@uni-bremen.de} diff --git a/man/pyrithione.Rd b/man/pyrithione.Rd index b24a906..f2d3064 100644 --- a/man/pyrithione.Rd +++ b/man/pyrithione.Rd @@ -11,6 +11,9 @@ \format{ A dataframe containing the data as required for the \code{\link{drfit}} function. } +\examples{ + \dontrun{demo(pyrithione)} +} \source{ Doose C, Ranke J, Stock F, Bottin-Weber U, Jastorff B (2004) Structure-activity relationships of pyrithiones - IPC-81 toxicity tests with diff --git a/tests/IM1xIPC81.R b/tests/IM1xIPC81.R new file mode 100644 index 0000000..075c84d --- /dev/null +++ b/tests/IM1xIPC81.R @@ -0,0 +1,4 @@ +library(drfit) +data(IM1xIPC81) +rIM1xIPC81 <- drfit(IM1xIPC81,linlogit=TRUE) +rIM1xIPC81 diff --git a/tests/IM1xIPC81.Rout.save b/tests/IM1xIPC81.Rout.save new file mode 100644 index 0000000..b67ed2a --- /dev/null +++ b/tests/IM1xIPC81.Rout.save @@ -0,0 +1,75 @@ + +R : Copyright 2006, The R Foundation for Statistical Computing +Version 2.3.0 (2006-04-24) +ISBN 3-900051-07-0 + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> library(drfit) +Loading required package: RODBC +> data(IM1xIPC81) +> rIM1xIPC81 <- drfit(IM1xIPC81,linlogit=TRUE) + +IM13 BF4: Fitting data... + +IM14 BF4: Fitting data... +Error in nls(response ~ linlogitf(dose, 1, f, logED50, b), data = tmp, : + singular gradient +Error in numericDeriv(form[[3]], names(ind), env) : + Missing value or an infinity produced when evaluating the model +In addition: Warning message: +NaNs produced in: pnorm(q, mean, sd, lower.tail, log.p) + +IM15 BF4: Fitting data... + +IM16 BF4: Fitting data... + +IM17 BF4: Fitting data... +Error in numericDeriv(form[[3]], names(ind), env) : + Missing value or an infinity produced when evaluating the model +In addition: Warning message: +NaNs produced in: pnorm(q, mean, sd, lower.tail, log.p) + +IM18 BF4: Fitting data... +Error in numericDeriv(form[[3]], names(ind), env) : + Missing value or an infinity produced when evaluating the model +In addition: Warning message: +NaNs produced in: pnorm(q, mean, sd, lower.tail, log.p) + +IM19 BF4: Fitting data... +Error in numericDeriv(form[[3]], names(ind), env) : + Missing value or an infinity produced when evaluating the model +In addition: Warning message: +NaNs produced in: pnorm(q, mean, sd, lower.tail, log.p) + +IM1-10 BF4: Fitting data... +> rIM1xIPC81 + Substance ndl n lld lhd mtype logED50 std unit +1 IM13 BF4 9 81 0.59176003 3.000000 inactive NA NA 然 +2 IM14 BF4 20 216 -0.01030017 3.176091 no fit NA NA 然 +3 IM15 BF4 9 135 0.59176003 3.000000 inactive NA NA 然 +4 IM16 BF4 9 108 0.59176003 3.000000 inactive NA NA 然 +5 IM17 BF4 9 81 0.59176003 3.000000 linlogit 2.5785719 0.03819482 然 +6 IM18 BF4 9 135 0.59176003 3.000000 linlogit 1.6806040 0.02982682 然 +7 IM19 BF4 9 81 0.59176003 3.000000 linlogit 1.6496121 0.02636274 然 +8 IM1-10 BF4 11 162 -0.01030017 3.000000 linlogit 0.7696961 0.04165397 然 + sigma a b c +1 NA NA NA NA +2 NA NA NA NA +3 NA NA NA NA +4 NA NA NA NA +5 0.2375857 2.5785719 2.300216 0.01468034 +6 0.2324871 1.6806040 2.237338 0.05719295 +7 0.1452716 1.6496121 1.976976 0.10956088 +8 0.2987708 0.7696961 1.936253 0.45808611 +> diff --git a/tests/IM1xVibrio.R b/tests/IM1xVibrio.R new file mode 100644 index 0000000..ed1a698 --- /dev/null +++ b/tests/IM1xVibrio.R @@ -0,0 +1,4 @@ +library(drfit) +data(IM1xVibrio) +rIM1xVibrio <- drfit(IM1xVibrio) +rIM1xVibrio diff --git a/tests/IM1xVibrio.Rout.save b/tests/IM1xVibrio.Rout.save new file mode 100644 index 0000000..5d37703 --- /dev/null +++ b/tests/IM1xVibrio.Rout.save @@ -0,0 +1,57 @@ + +R : Copyright 2006, The R Foundation for Statistical Computing +Version 2.3.0 (2006-04-24) +ISBN 3-900051-07-0 + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> library(drfit) +Loading required package: RODBC +> data(IM1xVibrio) +> rIM1xVibrio <- drfit(IM1xVibrio) + +IM13 BF4: Fitting data... + +IM14 BF4: Fitting data... + +IM15 BF4: Fitting data... + +IM16 BF4: Fitting data... + +IM17 BF4: Fitting data... + +IM18 BF4: Fitting data... + +IM19 BF4: Fitting data... + +IM1-10 BF4: Fitting data... +> rIM1xVibrio + Substance ndl n lld lhd mtype logED50 std unit +1 IM13 BF4 13 22 -5.30103 4.69897 probit 3.9399128 0.03658457 然 +2 IM14 BF4 12 57 -4.30103 4.69897 probit 3.5442110 0.02060194 然 +3 IM15 BF4 7 20 -0.30103 4.69897 probit 3.1398488 0.01254468 然 +4 IM16 BF4 13 30 -4.30103 4.69897 probit 3.1804247 0.01801591 然 +5 IM17 BF4 10 20 -1.30103 4.69897 probit 2.4317301 0.03015341 然 +6 IM18 BF4 10 17 -2.30103 2.69897 probit 1.4015187 0.04053083 然 +7 IM19 BF4 13 22 -5.30103 2.69897 probit 0.7157942 0.02085130 然 +8 IM1-10 BF4 11 20 -6.30103 2.69897 probit -0.1790307 0.03623821 然 + sigma a b +1 0.06302893 3.9399128 0.5763074 +2 0.05905375 3.5442110 0.6561300 +3 0.02695476 3.1398488 0.5526675 +4 0.04514079 3.1804247 0.4881559 +5 0.04773317 2.4317301 0.6386547 +6 0.05611347 1.4015187 0.8008513 +7 0.02956284 0.7157942 0.6969275 +8 0.04098662 -0.1790307 0.8019351 +> diff --git a/tests/XY.R b/tests/XY.R new file mode 100644 index 0000000..e295be4 --- /dev/null +++ b/tests/XY.R @@ -0,0 +1,4 @@ +library(drfit) +data(XY) +rXY <- drfit(XY) +rXY diff --git a/tests/XY.Rout.save b/tests/XY.Rout.save new file mode 100644 index 0000000..7bcc0df --- /dev/null +++ b/tests/XY.Rout.save @@ -0,0 +1,37 @@ + +R : Copyright 2006, The R Foundation for Statistical Computing +Version 2.3.0 (2006-04-24) +ISBN 3-900051-07-0 + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> library(drfit) +Loading required package: RODBC +> data(XY) +> rXY <- drfit(XY) + +Control: Fitting data... + +Substance X: Fitting data... + +Substance Y: Fitting data... +> rXY + Substance ndl n lld lhd mtype logED50 std unit sigma +1 Control 1 6 -Inf -Inf inactive NA NA mg/L NA +2 Substance X 4 12 1 3 probit 2.161905 0.02425144 mg/L 0.04131746 +3 Substance Y 4 12 1 3 active NA NA mg/L NA + a b +1 NA NA +2 2.161905 0.5061306 +3 NA NA +> diff --git a/tests/antifoul.R b/tests/antifoul.R new file mode 100644 index 0000000..f9c1a9d --- /dev/null +++ b/tests/antifoul.R @@ -0,0 +1,4 @@ +library(drfit) +data(antifoul) +rantifoul <- drfit(antifoul) +rantifoul diff --git a/tests/antifoul.Rout.save b/tests/antifoul.Rout.save new file mode 100644 index 0000000..5bc166c --- /dev/null +++ b/tests/antifoul.Rout.save @@ -0,0 +1,33 @@ + +R : Copyright 2006, The R Foundation for Statistical Computing +Version 2.3.0 (2006-04-24) +ISBN 3-900051-07-0 + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> library(drfit) +Loading required package: RODBC +> data(antifoul) +> rantifoul <- drfit(antifoul) + +TBT: Fitting data... + +Zn Pyrithion: Fitting data... +> rantifoul + Substance ndl n lld lhd mtype logED50 std unit +1 TBT 38 135 -2.709271 2.39794 probit -0.1643560 0.05349216 然 +2 Zn Pyrithion 27 81 -2.107210 2.00000 probit -0.3979222 0.05393693 然 + sigma a b +1 0.1928611 -0.1643560 0.6763882 +2 0.2286560 -0.3979222 0.4169632 +> diff --git a/tests/pyrithione.R b/tests/pyrithione.R new file mode 100644 index 0000000..f05988d --- /dev/null +++ b/tests/pyrithione.R @@ -0,0 +1,4 @@ +library(drfit) +data(pyrithione) +rpyr <- drfit(pyrithione,linlogit=TRUE,linlogitWrong=c("MSPT","MSPHI")) +rpyr diff --git a/tests/pyrithione.Rout.save b/tests/pyrithione.Rout.save new file mode 100644 index 0000000..fb11ca9 --- /dev/null +++ b/tests/pyrithione.Rout.save @@ -0,0 +1,85 @@ + +R : Copyright 2006, The R Foundation for Statistical Computing +Version 2.3.0 (2006-04-24) +ISBN 3-900051-07-0 + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> library(drfit) +Loading required package: RODBC +> data(pyrithione) +> rpyr <- drfit(pyrithione,linlogit=TRUE,linlogitWrong=c("MSPT","MSPHI")) + +Na Pyrithion: Fitting data... + +Pyridin: Fitting data... + +PyNO: Fitting data... + +(PT)2: Fitting data... + +MSO2P: Fitting data... + +MSPHI: Fitting data... + +PyS: Fitting data... +Error in nls(response ~ linlogitf(dose, 1, f, logED50, b), data = tmp, : + step factor 0.000488281 reduced below 'minFactor' of 0.000976562 + +Zn Pyrithion: Fitting data... + +Cu Pyrithion: Fitting data... + +Fe Pyrithion: Fitting data... + +(PyS)2: Fitting data... +Error in nls(response ~ linlogitf(dose, 1, f, logED50, b), data = tmp, : + singular gradient + +MSPT: Fitting data... + +TBT: Fitting data... + +NaJ: Fitting data... +> rpyr + Substance ndl n lld lhd mtype logED50 std unit +1 Na Pyrithion 20 108 -2.107210 2.00000 linlogit -0.3461318 0.04237833 然 +2 Pyridin 19 161 0.591760 3.69897 inactive NA NA 然 +3 PyNO 19 81 0.591760 3.69897 no fit NA NA 然 +4 (PT)2 19 81 -2.408240 2.00000 linlogit -0.4197031 0.05030460 然 +5 MSO2P 28 108 -1.709271 3.69897 inactive NA NA 然 +6 MSPHI 19 81 0.591760 3.69897 probit 3.6625025 0.06724673 然 +7 PyS 18 80 -0.408240 3.00000 probit 2.6817944 0.02031252 然 +8 Zn Pyrithion 27 81 -2.107210 2.00000 linlogit -0.4132885 0.06234927 然 +9 Cu Pyrithion 19 79 -2.408240 2.00000 linlogit -0.3074717 0.07918130 然 +10 Fe Pyrithion 19 81 -2.408240 2.00000 linlogit -0.3534572 0.07263386 然 +11 (PyS)2 20 81 -0.408240 3.00000 probit 1.7840499 0.05230663 然 +12 MSPT 18 108 -0.408240 3.00000 probit 2.1384811 0.03379904 然 +13 TBT 38 135 -2.709271 2.39794 linlogit -0.1580954 0.05474371 然 +14 NaJ 10 108 0.591760 3.30103 inactive NA NA 然 + sigma a b c +1 0.20857751 -0.3461318 2.1188272 -0.26698979 +2 NA NA NA NA +3 0.09188853 NA NA NA +4 0.20509070 -0.4197031 1.8466994 -0.51508088 +5 NA NA NA NA +6 0.12943273 3.6625025 0.4387540 NA +7 0.13401920 2.6817944 0.1250523 NA +8 0.22877916 -0.4132885 1.7424846 0.61078660 +9 0.24494451 -0.3074717 1.0150649 -0.04897422 +10 0.23383185 -0.3534572 1.1823558 0.02510613 +11 0.23298721 1.7840499 0.4098018 NA +12 0.22881257 2.1384811 0.2112625 NA +13 0.19264079 -0.1580954 1.0406576 -0.02416104 +14 NA NA NA NA +> -- cgit v1.2.1