Skip to content

Commit

Permalink
lint whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
hanneoberman committed Jul 26, 2024
1 parent c163aff commit 51a5569
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
14 changes: 5 additions & 9 deletions R/ggmice.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ ggmice <- function(data = NULL,
}
if (length(vrbs) > length(unique(vrbs))) {
cli::cli_abort(
c("The data must have unique column names.",
"x" = "Duplication found in {vrbs[duplicated(vrbs)]}")
c("The data must have unique column names.", "x" = "Duplication found in {vrbs[duplicated(vrbs)]}")
)
}
# extract mapping variables
Expand Down Expand Up @@ -107,8 +106,8 @@ ggmice <- function(data = NULL,
.imp = 0,
.id = rownames(data$data),
data$data
)[!miss_xy,],
data.frame(.where = "imputed", mice::complete(data, action = "long"))[where_xy,]
)[!miss_xy, ],
data.frame(.where = "imputed", mice::complete(data, action = "long"))[where_xy, ]
),
.where = factor(
.where,
Expand Down Expand Up @@ -154,7 +153,6 @@ ggmice <- function(data = NULL,
return(gg)
}


#' Utils function to extract mapping variables
#'
#' @param data Incomplete dataset or mids object.
Expand Down Expand Up @@ -197,11 +195,9 @@ match_mapping <- function(data, vrbs, mapping_in) {
inherits(try(dplyr::mutate(mapping_data,
!!rlang::parse_quo(mapping_text, env = rlang::current_env())),
silent = TRUE)
,
"try-error")) {
, "try-error")) {
cli::cli_abort(
c("Must provide a valid mapping variable.",
"x" = "Mapping variable '{mapping_text}' not found in the data or imputations.")
c("Must provide a valid mapping variable.", "x" = "Mapping variable '{mapping_text}' not found in the data or imputations.")
)
} else {
cli::cli_warn(
Expand Down
6 changes: 2 additions & 4 deletions R/plot_corr.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,11 @@ plot_corr <-
y = "Variable to impute",
fill = "Correlation*
",
caption = "*pairwise complete observations"
caption = "*pairwise complete observations"
)
} else {
gg <- gg +
ggplot2::labs(x = "Imputation model predictor",
y = "Variable to impute",
fill = "Correlation")
ggplot2::labs(x = "Imputation model predictor", y = "Variable to impute", fill = "Correlation")
}
if (label) {
gg <-
Expand Down

0 comments on commit 51a5569

Please sign in to comment.