From 81db664028332e30a56e2bea3c8f1e89709f40c7 Mon Sep 17 00:00:00 2001 From: pittlerf Date: Thu, 3 Oct 2019 12:57:10 +0200 Subject: [PATCH] correcting for the behaviour of is.na in if statement --- R/cf.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/cf.R b/R/cf.R index 77371e8a4..fe86f13b2 100644 --- a/R/cf.R +++ b/R/cf.R @@ -751,7 +751,7 @@ addStat.cf <- function(cf1, cf2,reverse1=FALSE, reverse2=FALSE) { icf1_temp <- cf1$icf if (reverse1 == TRUE){ apply(cf1_temp,2,rev) - if (!is.na(icf1_temp)){ + if (sum(is.na(icf1_temp))==0){ apply(icf1_temp,2,rev) } } @@ -759,7 +759,7 @@ addStat.cf <- function(cf1, cf2,reverse1=FALSE, reverse2=FALSE) { icf2_temp <- cf2$icf if (reverse2 == TRUE){ apply(cf2_temp,2,rev) - if (!is.na(icf2_temp)){ + if (sum(is.na(icf2_temp))==0){ apply(icf2_temp,2,rev) } }