Skip to content

Commit

Permalink
small fix so that outliers are not drawn, if there are none
Browse files Browse the repository at this point in the history
  • Loading branch information
dicook committed Mar 27, 2024
1 parent d888e29 commit 20c5035
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/display-xy.r
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,12 @@ display_xy <- function(center = TRUE, axes = "center", half_range = NULL,
#mdst <- mahal_dist(data, ellipse)
anomalies <- which(mdst > ellc)
#cat("1 ", length(anomalies), "\n")
points(x[anomalies,],
if (length(anomalies) > 0) {
points(x[anomalies,],
col = "red",
pch = 4,
cex = 2)
}
}
else
message("Check the variance-covariance matrix generating the ellipse\n")
Expand Down

0 comments on commit 20c5035

Please sign in to comment.