Skip to content

Commit 61613a4

Browse files
authored
Merge pull request #169 from amices/new_release
Prepare for `ggmice` v0.0.1
2 parents fbd78e7 + eee5d95 commit 61613a4

File tree

10 files changed

+78
-101
lines changed

10 files changed

+78
-101
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ inst/doc
99
docs
1010
*.psd
1111
*.pdf
12+
revdep/

DESCRIPTION

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: ggmice
22
Title: Visualizations for 'mice' with 'ggplot2'
3-
Version: 0.1.0.9000
3+
Version: 0.1.1
44
Authors@R: c(
55
person("Hanne", "Oberman", email = "[email protected]", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-3276-2141")),
@@ -18,8 +18,7 @@ Description: Enhance a 'mice' imputation workflow with visualizations for
1818
'ggmice' to inspect missing data, develop imputation models, evaluate
1919
algorithmic convergence, or compare observed versus imputed data.
2020
License: GPL (>= 3)
21-
URL: https://github.com/amices/ggmice, https://amices.org/,
22-
https://amices.org/ggmice/
21+
URL: https://amices.org/ggmice/
2322
BugReports: https://github.com/amices/ggmice/issues
2423
Imports:
2524
cli,

R/plot_pred.R

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@
99
#'
1010
#' @return An object of class `ggplot2::ggplot`.
1111
#'
12+
#' @details
13+
#' The predictor matrix in [mice::mice] determines the role an imputation model predictor takes in the imputation model.
14+
#' The rows correspond to incomplete target variables, and the columns to imputation model predictors.
15+
#'
16+
#' A value of `1` indicates that the column variable is a predictor to impute the target (row) variable. The value `0` means that it is not used as predictor.
17+
#'
18+
#' Imputation methods for multilevel data use other codes than `0` and `1`:
19+
#' - Methods `2l.bin`, `2l.lmer`, `2l.norm`, `2l.pan`, `2lonly.mean`, `2lonly.norm` and `2lonly.pmm` use code `-2` to indicate the class variable;
20+
#' - Methods `2l.bin`, `2l.lmer`, `2l.norm` and `2l.pan` use code `2` to indicate the random effects;
21+
#' - Method `2l.pan` uses codes `3` and `4` to add class means to codes `1` and `2` respectively.
22+
#'
23+
#' @references van Buuren, S. (2018). Flexible imputation of missing data. Chapman and Hall/CRC. [stefvanbuuren.name/fimd](https://stefvanbuuren.name/fimd/)
24+
#'
1225
#' @examples
1326
#' # generate a predictor matrix
1427
#' pred <- mice::quickpred(mice::nhanes)
@@ -46,8 +59,7 @@ plot_pred <-
4659
if (mice::is.mids(data)) {
4760
if (!is.null(method)) {
4861
cli::cli_warn(
49-
c("!" = "Input `method` is ignored when `data` is of class `mids`.",
50-
"i" = "The `method` vector from the `mids` object will be used.")
62+
c("!" = "Input `method` is ignored when `data` is of class `mids`.", "i" = "The `method` vector from the `mids` object will be used.")
5163
)
5264
}
5365
method <- data$method
@@ -80,12 +92,14 @@ plot_pred <-
8092
ind = matrix(data[vrb_matched, vrb_matched], nrow = p * p, byrow = TRUE)
8193
) %>% dplyr::mutate(clr = factor(
8294
.data$ind,
83-
levels = c(-3, -2, 0, 1, 2),
95+
levels = c(-3, -2, 0, 1, 2, 3, 4),
8496
labels = c(
8597
"inclusion-restriction variable",
8698
"cluster variable",
8799
"not used",
88100
"predictor",
101+
"random effect",
102+
"fixed effect",
89103
"random effect"
90104
),
91105
ordered = TRUE
@@ -112,7 +126,8 @@ plot_pred <-
112126
"cluster variable" = "lightyellow",
113127
"not used" = "grey90",
114128
"predictor" = "palegreen3",
115-
"random effect" = "deepskyblue"
129+
"random effect" = "deepskyblue",
130+
"fixed effect" = "deepskyblue"
116131
)
117132
) +
118133
ggplot2::labs(

R/plot_trace.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ plot_trace <- function(data,
4848
if (is.null(data$chainMean) && is.null(data$chainVar)) {
4949
cli::cli_abort("No convergence diagnostics found", call. = FALSE)
5050
}
51+
if (data$m < 2L && data$maxit < 2L) {
52+
cli::cli_abort("More iterations and/or imputations required", call. = FALSE)
53+
}
5154
vrb <- rlang::enexpr(vrb)
5255
vrbs_in_data <- names(data$imp)
5356
vrb_matched <- match_vrb(vrb, vrbs_in_data)

R/theme.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ theme_minimice <- function() {
2424
panel.grid.minor = ggplot2::element_blank(),
2525
panel.grid.major = ggplot2::element_blank(),
2626
axis.ticks = ggplot2::element_line(colour = "black"),
27+
axis.text = ggplot2::element_text(hjust = 0, vjust = 0),
2728
axis.title.y.right = ggplot2::element_text(margin = ggplot2::margin(l = 6))
2829
)
2930
}

cran-comments.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# ggmice 0.1.1
2+
3+
## R CMD check results
4+
5+
0 errors | 0 warnings | 0 notes
6+
7+
## Downstream dependencies
8+
9+
There are no downstream dependencies of 'ggmice' yet.
10+
11+
---
12+
113
# ggmice 0.1.0
214

315
## R CMD check results

man/figures/README-example-1.png

61.6 KB
Loading

man/figures/README-example-2.png

61.8 KB
Loading

man/plot_pred.Rd

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

revdep/README.md

Lines changed: 24 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,32 @@
11
# Platform
22

3-
|field |value |
4-
|:--------|:------------------------------------------------------------------------------------|
5-
|version |R version 4.3.0 (2023-04-21 ucrt) |
6-
|os |Windows 10 x64 (build 19045) |
7-
|system |x86_64, mingw32 |
8-
|ui |RStudio |
9-
|language |(EN) |
10-
|collate |Dutch_Netherlands.utf8 |
11-
|ctype |Dutch_Netherlands.utf8 |
12-
|tz |Europe/Amsterdam |
13-
|date |2023-07-24 |
14-
|rstudio |2023.06.1+524 Mountain Hydrangea (desktop) |
15-
|pandoc |3.1.1 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown) |
3+
|field |value |
4+
|:--------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
5+
|version |R version 4.5.0 (2025-04-11) |
6+
|os |macOS Sequoia 15.5 |
7+
|system |aarch64, darwin20 |
8+
|ui |RStudio |
9+
|language |(EN) |
10+
|collate |en_US.UTF-8 |
11+
|ctype |en_US.UTF-8 |
12+
|tz |Europe/Amsterdam |
13+
|date |2025-07-30 |
14+
|rstudio |2025.05.1+513 Mariposa Orchid (desktop) |
15+
|pandoc |NA |
16+
|quarto |1.6.42 @ /private/var/folders/mz/40zv3f2x0ws1bznpf0md3w7h0000gn/T/AppTranslocation/3852367F-EA29-4389-8A95-F2F66D6CA5E6/d/RStudio.app/Contents/Resources/app/quarto/bin/quarto |
1617

1718
# Dependencies
1819

19-
|package |old |new |Δ |
20-
|:------------|:----------|:----------|:--|
21-
|ggmice |0.0.1 |0.0.1.9000 |* |
22-
|backports |1.4.1 |1.4.1 | |
23-
|bit |4.0.5 |4.0.5 | |
24-
|bit64 |4.0.5 |4.0.5 | |
25-
|brio |1.1.3 |1.1.3 | |
26-
|broom |1.0.5 |1.0.5 | |
27-
|callr |3.7.3 |3.7.3 | |
28-
|cli |3.6.1 |3.6.1 | |
29-
|clipr |0.8.0 |0.8.0 | |
30-
|colorspace |2.1-0 |2.1-0 | |
31-
|cpp11 |0.4.5 |0.4.5 | |
32-
|crayon |1.5.2 |1.5.2 | |
33-
|desc |1.4.2 |1.4.2 | |
34-
|diffobj |0.3.5 |0.3.5 | |
35-
|digest |0.6.33 |0.6.33 | |
36-
|dplyr |1.1.2 |1.1.2 | |
37-
|ellipsis |0.3.2 |0.3.2 | |
38-
|evaluate |0.21 |0.21 | |
39-
|fansi |1.0.4 |1.0.4 | |
40-
|farver |2.1.1 |2.1.1 | |
41-
|forcats |1.0.0 |1.0.0 | |
42-
|foreach |1.5.2 |1.5.2 | |
43-
|fs |1.6.3 |1.6.3 | |
44-
|generics |0.1.3 |0.1.3 | |
45-
|ggplot2 |3.4.2 |3.4.2 | |
46-
|glmnet |4.1-7 |4.1-7 | |
47-
|glue |1.6.2 |1.6.2 | |
48-
|gtable |0.3.3 |0.3.3 | |
49-
|haven |2.5.3 |2.5.3 | |
50-
|hms |1.1.3 |1.1.3 | |
51-
|isoband |0.2.7 |0.2.7 | |
52-
|iterators |1.0.14 |1.0.14 | |
53-
|jomo |2.7-6 |2.7-6 | |
54-
|jsonlite |1.8.7 |1.8.7 | |
55-
|labeling |0.4.2 |0.4.2 | |
56-
|lifecycle |1.0.3 |1.0.3 | |
57-
|lme4 |1.1-34 |1.1-34 | |
58-
|magrittr |2.0.3 |2.0.3 | |
59-
|mice |3.16.0 |3.16.0 | |
60-
|minqa |1.2.5 |1.2.5 | |
61-
|mitml |0.4-5 |0.4-5 | |
62-
|munsell |0.5.0 |0.5.0 | |
63-
|nloptr |2.0.3 |2.0.3 | |
64-
|numDeriv |2016.8-1.1 |2016.8-1.1 | |
65-
|ordinal |2022.11-16 |2022.11-16 | |
66-
|pan |1.8 |1.8 | |
67-
|pillar |1.9.0 |1.9.0 | |
68-
|pkgconfig |2.0.3 |2.0.3 | |
69-
|pkgload |1.3.2.1 |1.3.2.1 | |
70-
|praise |1.0.0 |1.0.0 | |
71-
|prettyunits |1.1.1 |1.1.1 | |
72-
|processx |3.8.2 |3.8.2 | |
73-
|progress |1.2.2 |1.2.2 | |
74-
|ps |1.7.5 |1.7.5 | |
75-
|purrr |1.0.1 |1.0.1 | |
76-
|R6 |2.5.1 |2.5.1 | |
77-
|RColorBrewer |1.1-3 |1.1-3 | |
78-
|Rcpp |1.0.11 |1.0.11 | |
79-
|RcppEigen |0.3.3.9.3 |0.3.3.9.3 | |
80-
|readr |2.1.4 |2.1.4 | |
81-
|rematch2 |2.1.2 |2.1.2 | |
82-
|rlang |1.1.1 |1.1.1 | |
83-
|rprojroot |2.0.3 |2.0.3 | |
84-
|scales |1.2.1 |1.2.1 | |
85-
|shape |1.4.6 |1.4.6 | |
86-
|stringi |1.7.12 |1.7.12 | |
87-
|stringr |1.5.0 |1.5.0 | |
88-
|testthat |3.1.10 |3.1.10 | |
89-
|tibble |3.2.1 |3.2.1 | |
90-
|tidyr |1.3.0 |1.3.0 | |
91-
|tidyselect |1.2.0 |1.2.0 | |
92-
|tzdb |0.4.0 |0.4.0 | |
93-
|ucminf |1.2.0 |1.2.0 | |
94-
|utf8 |1.2.3 |1.2.3 | |
95-
|vctrs |0.6.3 |0.6.3 | |
96-
|viridisLite |0.4.2 |0.4.2 | |
97-
|vroom |1.6.3 |1.6.3 | |
98-
|waldo |0.5.1 |0.5.1 | |
99-
|withr |2.5.0 |2.5.0 | |
20+
|package |old |new |Δ |
21+
|:-------|:-----|:----------|:--|
22+
|ggmice |0.1.0 |0.1.0.9000 |* |
23+
|broom |NA |1.0.9 |* |
24+
|glmnet |NA |4.1-10 |* |
25+
|pillar |NA |1.11.0 |* |
26+
|purrr |NA |1.1.0 |* |
27+
|Rcpp |NA |1.1.0 |* |
28+
|tibble |NA |3.3.0 |* |
29+
|utf8 |NA |1.2.6 |* |
10030

10131
# Revdeps
10232

0 commit comments

Comments
 (0)