Skip to content

Commit

Permalink
Default method.id in cqplot() changed to 'r'
Browse files Browse the repository at this point in the history
  • Loading branch information
friendly committed Jan 10, 2025
1 parent 9f8fc10 commit 48e3d62
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* added plotting all X vs all Y to Rohwer doc
* added `schoolsites` dataset
* `cqplot()` now prints a warning if there are missing cases and also returns the upper tail p-values corresponding to Mahalanobis $D^2$.
* Default `method.id` in `cqplot()` changed to "r", to identify points with the largest $D^2$.

## Version 1.7.3 (2024-12-05)

Expand Down
35 changes: 22 additions & 13 deletions R/cqplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@
#' @param id.n number of points labeled. If \code{id.n=0}, the default, no
#' point identification occurs.
#' @param id.method point identification method. The default
#' \code{id.method="y"} will identify the \code{id.n} points with the largest
#' value of abs(y-mean(y)). See \code{\link[car]{showLabels}} for other
#' \code{id.method="r"} will identify the \code{id.n} points with the largest
#' value of abs(y), i.e., the largest Mahalanobis DSQ. See \code{\link[car]{showLabels}} for other
#' options.
#' @param id.cex size of text for point labels
#' @param id.col color for point labels
Expand Down Expand Up @@ -191,19 +191,28 @@ cqplot.mlm <-
#' @exportS3Method cqplot default
cqplot.default <-
function(x,
method=c("classical", "mcd", "mve"),
detrend=FALSE,
pch=19, col = palette()[1], cex = par("cex"),
ref.col="red", ref.lwd=2,
conf = 0.95,
env.col="gray", env.lwd=2, env.lty=1, env.fill=TRUE,
fill.alpha=0.2,
fill.color=trans.colors(ref.col, fill.alpha),
labels = if (!is.null(rownames(x))) rownames(x) else 1:nrow(x),
id.n, id.method="y", id.cex=1, id.col = palette()[1],
method = c("classical", "mcd", "mve"),
detrend = FALSE,
pch = 19,
col = palette()[1],
cex = par("cex"),
ref.col = "red",
ref.lwd = 2,
conf = 0.95,
env.col = "gray",
env.lwd = 2,
env.lty = 1,
env.fill = TRUE,
fill.alpha = 0.2,
fill.color = trans.colors(ref.col, fill.alpha),
labels = if (!is.null(rownames(x))) rownames(x) else 1:nrow(x),
id.n,
id.method = "r",
id.cex = 1,
id.col = palette()[1],
xlab, ylab,
main,
what=deparse(substitute(x)),
what = deparse(substitute(x)),
ylim, ...) {

# Function to shade concentration band
Expand Down
6 changes: 3 additions & 3 deletions man/cqplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48e3d62

Please sign in to comment.