Skip to content

Commit 0601442

Browse files
Fix tests for {poorman} update (#220)
* Fix tests for `{poorman}` update * use namespace * poorman update on CRAN * Ready for CRAN?
1 parent 34cf6bf commit 0601442

4 files changed

Lines changed: 21 additions & 20 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: datawizard
33
Title: Easy Data Wrangling and Statistical Transformations
4-
Version: 0.5.0.1
4+
Version: 0.5.1
55
Authors@R: c(
66
person("Indrajeet", "Patil", , "patilindrajeet.science@gmail.com", role = c("aut", "cre"),
77
comment = c(ORCID = "0000-0003-1995-6531", Twitter = "@patilindrajeets")),
@@ -46,7 +46,7 @@ Suggests:
4646
lme4,
4747
mediation,
4848
parameters,
49-
poorman,
49+
poorman (>= 0.2.6),
5050
psych,
5151
readxl,
5252
readr,

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# datawizard 0.5.1
2+
3+
* Fixes failing tests due to `{poorman}` update.
4+
15
# datawizard 0.5.0
26

37
MAJOR CHANGES

cran-comments.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
## Test environments
2-
* local R installation, R 4.2.0
3-
* ubuntu 16.04 (on github-actions), R 4.2.0
4-
* win-builder (devel)
5-
61
## R CMD check results
72

83
0 errors | 0 warnings | 0 note
94

5+
* Fixes failing tests due to `{poorman}` update.
6+
107
## revdepcheck results
118

129
Expect test failures in a few of the reverse dependencies. The authors of these

tests/testthat/test-data_reshape.R

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ test_that("error when overwriting existing column", {
444444

445445
test_that("reshape_wider equivalent to pivot_wider: ex 1", {
446446
x <- fish_encounters %>%
447-
pivot_wider(names_from = "station", values_from = "seen", values_fill = 0)
447+
tidyr::pivot_wider(names_from = "station", values_from = "seen", values_fill = 0)
448448

449449
y <- fish_encounters %>%
450450
reshape_wider(
@@ -467,7 +467,7 @@ test_that("reshape_wider equivalent to pivot_wider: ex 2", {
467467
production$production <- rnorm(nrow(production))
468468

469469
x <- production %>%
470-
pivot_wider(
470+
tidyr::pivot_wider(
471471
names_from = c(product, country),
472472
values_from = production
473473
)
@@ -483,7 +483,7 @@ test_that("reshape_wider equivalent to pivot_wider: ex 2", {
483483

484484
test_that("reshape_wider equivalent to pivot_wider: ex 3", {
485485
x <- us_rent_income %>%
486-
pivot_wider(
486+
tidyr::pivot_wider(
487487
names_from = variable,
488488
values_from = c(estimate, moe)
489489
)
@@ -499,7 +499,7 @@ test_that("reshape_wider equivalent to pivot_wider: ex 3", {
499499

500500
test_that("reshape_wider equivalent to pivot_wider: ex 4", {
501501
x <- us_rent_income %>%
502-
pivot_wider(
502+
tidyr::pivot_wider(
503503
names_from = variable,
504504
names_sep = ".",
505505
values_from = c(estimate, moe)
@@ -528,7 +528,7 @@ test_that("reshape_wider equivalent to pivot_wider: ex 5", {
528528
contacts$person_id <- cumsum(contacts$field == "name")
529529

530530
x <- contacts %>%
531-
pivot_wider(names_from = field, values_from = value)
531+
tidyr::pivot_wider(names_from = field, values_from = value)
532532

533533
y <- contacts %>%
534534
reshape_wider(names_from = "field", values_from = "value")
@@ -548,7 +548,7 @@ test_that("reshape_wider equivalent to pivot_wider: ex 6", {
548548
production$production <- rnorm(nrow(production))
549549

550550
x <- production %>%
551-
pivot_wider(
551+
tidyr::pivot_wider(
552552
names_from = c(product, country),
553553
values_from = production,
554554
names_glue = "prod_{product}_{country}"
@@ -573,7 +573,7 @@ test_that("reshape_wider, names_glue works", {
573573
)
574574

575575
x <- df %>%
576-
pivot_wider(
576+
tidyr::pivot_wider(
577577
id_cols = food,
578578
names_from = c(car, binary),
579579
names_glue = "{binary}_{car}",
@@ -598,7 +598,7 @@ test_that("reshape_wider, names_glue works", {
598598

599599
test_that("reshape_longer equivalent to pivot_longer: ex 1", {
600600
x <- relig_income %>%
601-
pivot_longer(!religion, names_to = "income", values_to = "count")
601+
tidyr::pivot_longer(!religion, names_to = "income", values_to = "count")
602602

603603
y <- relig_income %>%
604604
reshape_longer(select = -religion, names_to = "income", values_to = "count")
@@ -609,7 +609,7 @@ test_that("reshape_longer equivalent to pivot_longer: ex 1", {
609609

610610
test_that("reshape_longer equivalent to pivot_longer: ex 2", {
611611
x <- billboard %>%
612-
pivot_longer(
612+
tidyr::pivot_longer(
613613
cols = starts_with("wk"),
614614
names_to = "week",
615615
values_to = "rank"
@@ -628,7 +628,7 @@ test_that("reshape_longer equivalent to pivot_longer: ex 2", {
628628

629629
test_that("reshape_longer equivalent to pivot_longer: ex 3", {
630630
x <- billboard %>%
631-
pivot_longer(
631+
tidyr::pivot_longer(
632632
cols = starts_with("wk"),
633633
names_to = "week",
634634
values_to = "rank",
@@ -649,7 +649,7 @@ test_that("reshape_longer equivalent to pivot_longer: ex 3", {
649649

650650
test_that("reshape_longer equivalent to pivot_longer: ex 4", {
651651
x <- billboard %>%
652-
pivot_longer(
652+
tidyr::pivot_longer(
653653
cols = starts_with("wk"),
654654
names_to = "week",
655655
names_prefix = "wk",
@@ -673,7 +673,7 @@ test_that("reshape_longer equivalent to pivot_longer: ex 4", {
673673
test_that("reshape_longer equivalent to pivot_longer: ex 5", {
674674
suppressWarnings({
675675
x <- who %>%
676-
pivot_longer(
676+
tidyr::pivot_longer(
677677
cols = 5:60,
678678
names_to = c("diagnosis", "gender", "age"),
679679
names_sep = "_",
@@ -694,7 +694,7 @@ test_that("reshape_longer equivalent to pivot_longer: ex 5", {
694694

695695
test_that("reshape_longer equivalent to pivot_longer: ex 6", {
696696
x <- who %>%
697-
pivot_longer(
697+
tidyr::pivot_longer(
698698
cols = new_sp_m014:newrel_f65,
699699
names_to = c("diagnosis", "gender", "age"),
700700
names_pattern = "new_?(.*)_(.)(.*)",

0 commit comments

Comments
 (0)