@@ -444,7 +444,7 @@ test_that("error when overwriting existing column", {
444444
445445test_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
484484test_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
500500test_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
599599test_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
610610test_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
629629test_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
650650test_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", {
673673test_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
695695test_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