Skip to content

Commit

Permalink
Update plot_pred.R
Browse files Browse the repository at this point in the history
  • Loading branch information
pepijnvink committed Dec 14, 2023
1 parent e367963 commit 60d7bf2
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions R/plot_pred.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,26 @@ plot_pred <-
data <- data$predictorMatrix
}
p <- nrow(data)
if (!mice::is.mids(data)) {
if (!is.null(method) && is.character(method)) {
if (length(method) == 1) {
method <- rep(method, p)
}
if (length(method) == p) {
ylabel <- "Imputation method"
}
if (!is.null(method) && is.character(method)) {
if (length(method) == 1) {
method <- rep(method, p)
}
if (is.null(method)) {
method <- rep("", p)
ylabel <- ""
}
if (!is.character(method) || length(method) != p) {
cli::cli_abort("Method should be NULL or a character string or vector (of length 1 or `ncol(data)`).")
if (length(method) == p) {
ylabel <- "Imputation method"
}
}
if (is.null(method)) {
method <- rep("", p)
ylabel <- ""
}
if (!is.character(method) || length(method) != p) {
cli::cli_abort("Method should be NULL or a character string or vector (of length 1 or `ncol(data)`).")
}
vrb <- substitute(vrb)
if (vrb[1] == "all") {
vrb <- names(data)
} else {
vrb <- names(dplyr::select(as.data.frame(data), {
{
vrb
}
}))
vrb <- names(dplyr::select(as.data.frame(data), {{vrb}}))
}
vrbs <- row.names(data)
long <- data.frame(
Expand Down

0 comments on commit 60d7bf2

Please sign in to comment.