Try to fix R 4.3 compatibility
Change-Id: I22c4e58d8e946eb2c7b24ba995711a16d40adeea
diff --git a/R/derekovecs_apicall_syn_nlc.R b/R/derekovecs_apicall_syn_nlc.R
index 93ab249..23bd92a 100644
--- a/R/derekovecs_apicall_syn_nlc.R
+++ b/R/derekovecs_apicall_syn_nlc.R
@@ -24,14 +24,14 @@
content(response, as = 'parsed', type = 'application/json', simplifyDataFrame = TRUE)
}
else {
- return(NA)
+ return(NULL)
}
}
getW2VCollocates <- function(wordform = "Grund", ...) {
ret<-DeReKoVecsCall(wordform, ...)
- if(!is.na(ret)) ret$collocators
- else NA
+ if(!is.null(ret)) ret$collocators
+ else NULL
}
getClassicCollocates <- function(wordform = "Grund") {
@@ -41,7 +41,7 @@
content(response, as = 'parsed', type = 'application/json', simplifyDataFrame = TRUE)$collocates
}
else {
- return(NA)
+ return(null)
}
}
@@ -49,7 +49,7 @@
getBoth <- function(wordform = "Schmetterlinge") {
w2v <- getW2VCollocates(wordform)
classic <- getClassicCollocates(wordform)
- if (length(w2v)>0 && length(classic>0) && !is.na(w2v) && !is.na(classic)) {
+ if (!is.null(w2v) && !is.null(classic)) {
merge(classic,w2v,by="word",all=TRUE)
}
else {
@@ -58,7 +58,7 @@
}
getRanks <- function(collocates,NApenalty=1000) {
- if (is.na(collocates)) {
+ if (is.null(collocates)) {
return(NA)
}
both <<-