From eca31f4b2008b7226ed8cf7f291f2b974130a912 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Tue, 8 Mar 2022 19:09:41 -0800 Subject: [PATCH] Use !anyNA() over all(!is.na(.)) `all(!(.))` is logically equivalent to `!any(.)`; in this case, that means we can use the specialized `anyNA()` instead as well --- R/plot.cca.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/plot.cca.R b/R/plot.cca.R index b0aec1312..707264f0d 100644 --- a/R/plot.cca.R +++ b/R/plot.cca.R @@ -117,7 +117,7 @@ biplabs <- ordiArrowTextXY(mul * g$regression, rownames(g$regression)) text(biplabs, rownames(g$regression), col = rcol) } - if (!is.null(g$centroids) && all(!is.na(g$centroids)) && type != + if (!is.null(g$centroids) && !anyNA(g$centroids) && type != "none") { if (type == "text") text(g$centroids, rownames(g$centroids), col = "blue")