aboutsummaryrefslogtreecommitdiff
path: root/R/checksubstance.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/checksubstance.R
parent5de108a65125a443d12bff7fbbde946ffa92f644 (diff)
Maintenance changes for the release of 0.6.4v0.6.4
Diffstat (limited to 'R/checksubstance.R')
-rw-r--r--R/checksubstance.R10
1 files changed, 7 insertions, 3 deletions
diff --git a/R/checksubstance.R b/R/checksubstance.R
index b50c3da..3e07f92 100644
--- a/R/checksubstance.R
+++ b/R/checksubstance.R
@@ -11,7 +11,11 @@ checksubstance <- function(substance, db = "cytotox", experimentator = "%",
if (!(db %in% rownames(databases))) stop("Database is not supported")
- channel <- odbcConnect(db,uid="cytotox",pwd="cytotox",case="tolower")
+ if (requireNamespace("RODBC")) {
+ channel <- RODBC::odbcConnect(db, uid="cytotox", pwd="cytotox", case="tolower")
+ } else {
+ stop("For this function, the RODBC package has to be installed and configured.")
+ }
responsename = as.character(databases[db,1])
testtype = as.character(databases[db,2])
@@ -41,8 +45,8 @@ checksubstance <- function(substance, db = "cytotox", experimentator = "%",
endpoint, "'", sep = "")
}
- data <- sqlQuery(channel,query)
- odbcClose(channel)
+ data <- RODBC::sqlQuery(channel,query)
+ RODBC::odbcClose(channel)
if (length(data$experimentator) < 1) {
stop(paste("\nNo response data for",substance,"in database",

Contact - Imprint