Skip to content

Commit

Permalink
change difference plot to imp-obs (instead of obs-imp)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanneoberman committed Oct 18, 2024
1 parent 7323911 commit 75b9958
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/plot_corr.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ plot_corr <-
if (diff) {
lab_fill <- "Difference in correlations*
"
lab_note <- "*observed minus imputed (pooled across imputations)"
lab_note <- "*pooled imputed minus observed"
}
# compute correlations
if (!imp | diff) {

Check warning on line 93 in R/plot_corr.R

View workflow job for this annotation

GitHub Actions / lint

file=R/plot_corr.R,line=93,col=14,[vector_logic_linter] Conditional expressions require scalar logical operators (&& and ||)
Expand All @@ -99,7 +99,7 @@ plot_corr <-
stats::cov2cor(stats::cov(data.matrix(.x[, vrb_matched]), use = "pairwise.complete.obs"))
})
if (diff) {
corr <- corr - (Reduce("+", corrs) / length(corrs))
corr <- (Reduce("+", corrs) / length(corrs)) - corr
} else {
corr <- Reduce("+", corrs) / length(corrs)
}
Expand Down

0 comments on commit 75b9958

Please sign in to comment.