Skip to content

Commit

Permalink
Merge pull request #328 from easystats/fix_datawizard_issues
Browse files Browse the repository at this point in the history
Fix failing checks due to changes in forthcoming datawizard
  • Loading branch information
strengejacke authored Oct 8, 2024
2 parents 5e7b0f2 + 892b86c commit 16da619
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: correlation
Title: Methods for Correlation Analysis
Version: 0.8.5.1
Version: 0.8.5.2
Authors@R:
c(person(given = "Dominique",
family = "Makowski",
Expand Down Expand Up @@ -54,10 +54,10 @@ BugReports: https://github.com/easystats/correlation/issues
Depends:
R (>= 3.6)
Imports:
bayestestR (>= 0.14.0),
bayestestR (>= 0.15.0),
datasets,
datawizard (>= 0.12.3),
insight (>= 0.20.4),
datawizard (>= 0.13.0),
insight (>= 0.20.5),
parameters (>= 0.22.2),
stats
Suggests:
Expand Down Expand Up @@ -95,3 +95,4 @@ Config/Needs/website:
rstudio/bslib,
r-lib/pkgdown,
easystats/easystatstemplate
Remotes: easystats/bayestestR#678
2 changes: 1 addition & 1 deletion R/utils_clean_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.clean_data <- function(data, include_factors = TRUE, multilevel = FALSE) {
if (!multilevel) {
if (include_factors) {
data <- datawizard::to_numeric(data)
data <- datawizard::to_numeric(data, dummy_factors = TRUE)
} else {
data <- data[sapply(data, is.numeric)]
}
Expand Down
5 changes: 1 addition & 4 deletions tests/testthat/_snaps/renaming.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# renaming columns

Code
correlation(anscombe, select = c("x1", "x2"), rename = c("var1"))
Condition
Warning:
Mismatch between number of variables and names.
print(out)
Output
# Correlation Matrix (pearson-method)
Expand Down
11 changes: 7 additions & 4 deletions tests/testthat/test-renaming.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
test_that("renaming columns", {
# should warn the user
expect_snapshot(correlation(anscombe,
select = c("x1", "x2"),
rename = c("var1")
))
expect_warning({
out <- correlation(anscombe,
select = c("x1", "x2"),
rename = "var1"
)
})
expect_snapshot(print(out))

expect_snapshot(correlation(anscombe,
select = c("x1", "x2"),
Expand Down

0 comments on commit 16da619

Please sign in to comment.