Use missing instead of is.na to deal with not given parameters
Change-Id: Id7a6153ca3f98cc6e530ca07af8c7a7317251c6a
diff --git a/R/KorAPConnection.R b/R/KorAPConnection.R
index 4652927..5ecd11c 100644
--- a/R/KorAPConnection.R
+++ b/R/KorAPConnection.R
@@ -10,13 +10,13 @@
#' @note Currently it is not possible to authenticate the client
#'
#' @export
-KorAPConnection <- function(KorAPUrl=defaultKorAPUrl, apiVersion='v1.0', apiUrl = NA) {
+KorAPConnection <- function(KorAPUrl=defaultKorAPUrl, apiVersion='v1.0', apiUrl) {
m <-regexpr("https?://[^?]+", KorAPUrl, perl = TRUE)
KorAPUrl <- regmatches(KorAPUrl, m)
if (!endsWith(KorAPUrl, '/')) {
KorAPUrl <- paste0(KorAPUrl, "/")
}
- if (is.na(apiUrl)) {
+ if (missing(apiUrl)) {
apiUrl = paste0(KorAPUrl, 'api/', apiVersion, '/')
}
con <- data.frame(apiUrl, KorAPUrl, apiVersion)