Skip to content

Commit

Permalink
Use !anyNA() over all(!is.na(.))
Browse files Browse the repository at this point in the history
`all(!(.))` is logically equivalent to `!any(.)`; in this case, that means we can use the specialized `anyNA()` instead as well
  • Loading branch information
MichaelChirico authored Mar 9, 2022
1 parent 48b7543 commit eca31f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/plot.cca.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit eca31f4

Please sign in to comment.