aboutsummaryrefslogtreecommitdiff
path: root/R/drdata.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2015-10-07 17:19:21 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2015-10-07 17:19:21 +0200
commitcc66ea8e99f809c53cb5a23430b814f68efdb126 (patch)
tree5bfd2ce2608560ffa399b7761003de14a0ede1de /R/drdata.R
parent5de108a65125a443d12bff7fbbde946ffa92f644 (diff)
Maintenance changes for the release of 0.6.4v0.6.4
Diffstat (limited to 'R/drdata.R')
-rw-r--r--R/drdata.R16
1 files changed, 10 insertions, 6 deletions
diff --git a/R/drdata.R b/R/drdata.R
index 15c61ac..0bf9597 100644
--- a/R/drdata.R
+++ b/R/drdata.R
@@ -1,9 +1,10 @@
drdata <- function(substances, experimentator = "%", db = "cytotox",
- celltype="IPC-81",enzymetype="AChE",
- organism="Vibrio fischeri",endpoint="Luminescence",whereClause="1",
- ok="'ok','no fit'")
+ celltype = "IPC-81", enzymetype = "AChE",
+ organism = "Vibrio fischeri", endpoint = "Luminescence", whereClause = "1",
+ ok = "'ok','no fit'")
{
- channel <- odbcConnect(db,uid="cytotox",pwd="cytotox",case="tolower")
+ if (requireNamespace("RODBC")) {
+ channel <- RODBC::odbcConnect(db,uid="cytotox",pwd="cytotox",case="tolower")
slist <- paste(substances,collapse="','")
if (db == "cytotox") {
responsetype <- "viability"
@@ -29,10 +30,13 @@ drdata <- function(substances, experimentator = "%", db = "cytotox",
whereClause," AND ok in (",
ok,")",sep="")
if (db == "ecotox") query <- paste(query," AND type LIKE '",endpoint,"'",sep="")
- data <- sqlQuery(channel,query)
- odbcClose(channel)
+ data <- RODBC::sqlQuery(channel,query)
+ RODBC::odbcClose(channel)
names(data)[[1]] <- "dose"
names(data)[[2]] <- "response"
data$substance <- factor(data$substance,levels=substances)
return(data)
+ } else {
+ stop("For this function, the RODBC package has to be installed and configured.")
+ }
}

Contact - Imprint