Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group by .imp if group=NULL #136

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions R/ggmice.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
.imp = 0,
.id = rownames(data$data),
data$data
)[!miss_xy,],

Check warning on line 110 in R/ggmice.R

View workflow job for this annotation

GitHub Actions / lint

file=R/ggmice.R,line=110,col=20,[commas_linter] Commas should always have a space after.
data.frame(.where = "imputed", mice::complete(data, action = "long"))[where_xy,]

Check warning on line 111 in R/ggmice.R

View workflow job for this annotation

GitHub Actions / lint

file=R/ggmice.R,line=111,col=88,[commas_linter] Commas should always have a space after.
),
.where = factor(
.where,
Expand All @@ -119,6 +119,10 @@
)
mice_mapping <-
utils::modifyList(mapping, ggplot2::aes(colour = .where))
if (is.null(mapping$group)) {
mice_mapping <-
utils::modifyList(mice_mapping, ggplot2::aes(group = .imp))
}
mice_colors <-
c("observed" = "#006CC2B3",
"imputed" = "#B61A51B3")
Expand All @@ -133,7 +137,7 @@

# edit plot to display missing values on the axes
if (is.data.frame(data) &&
!is.null(mapping$x) && !is.null(mapping$y)) {

Check warning on line 140 in R/ggmice.R

View workflow job for this annotation

GitHub Actions / lint

file=R/ggmice.R,line=140,col=6,[indentation_linter] Indentation should be 8 spaces but is 6 spaces.
gg <- gg +
ggplot2::coord_cartesian(clip = "off")
if (!is.null(mapping$x)) {
Expand Down Expand Up @@ -187,14 +191,14 @@
mapping_out <- mapping_text
}
if ((mice::is.mids(data) &&
mapping_text %in% c(".id", ".imp", ".where"))) {

Check warning on line 194 in R/ggmice.R

View workflow job for this annotation

GitHub Actions / lint

file=R/ggmice.R,line=194,col=7,[indentation_linter] Indentation should be 9 spaces but is 7 spaces.
mapping_out <- NULL
}
if (!is.null(mapping_in) &&
mapping_text %nin% c(vrbs, ".id", ".imp", ".where")) {

Check warning on line 198 in R/ggmice.R

View workflow job for this annotation

GitHub Actions / lint

file=R/ggmice.R,line=198,col=6,[indentation_linter] Indentation should be 8 spaces but is 6 spaces.
mapping_out <- vrbs[stringr::str_detect(mapping_text, vrbs)]
if (identical(mapping_out, character(0)) ||
inherits(try(dplyr::mutate(mapping_data,

Check warning on line 201 in R/ggmice.R

View workflow job for this annotation

GitHub Actions / lint

file=R/ggmice.R,line=201,col=8,[indentation_linter] Indentation should be 10 spaces but is 8 spaces.
!!rlang::parse_quo(mapping_text, env = rlang::current_env())),
silent = TRUE)
,
Expand Down
Loading