Skip to content

Fix deprecated dplyr functions in vignette#23

Merged
Ulthran merged 3 commits intomasterfrom
copilot/fix-deprecated-add-rownames-issue
Feb 4, 2026
Merged

Fix deprecated dplyr functions in vignette#23
Ulthran merged 3 commits intomasterfrom
copilot/fix-deprecated-add-rownames-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

Vignette rebuild fails on deprecated dplyr functions that are now defunct.

Changes

  • vignettes/zibr.Rmd: Replace 4 instances of add_rownames() with rownames_to_column()
    • Lines 175, 182: Data joins with sample.info
    • Lines 250, 257: P-value adjustment for ZIBR and LME results
  • vignettes/zibr.Rmd: Replace 2 instances of mutate_each(funs()) with mutate(across())
    • Lines 250, 257: Changed mutate_each(funs(p.adjust(., "fdr")), -Species) to mutate(across(-Species, ~p.adjust(., "fdr")))
  • vignettes/zibr.Rmd: Add library(tibble) to setup chunk
  • DESCRIPTION: Add tibble to Suggests

Deprecated Functions Fixed

  • add_rownames() - deprecated in dplyr 1.0.0, replaced with tibble::rownames_to_column()
  • mutate_each() and funs() - deprecated in dplyr 0.7.0, replaced with mutate() + across()
Original prompt

Version: 1.0.2
Check: re-building of vignette outputs
Result: ERROR
Error(s) in re-building vignettes:
...
--- re-building ‘zibr.Rmd’ using rmarkdown

Quitting from zibr.Rmd:169-286 [unnamed-chunk-11]

<error/lifecycle_error_deprecated>
Error:
! `add_rownames()` was deprecated in dplyr 1.0.0 and is now defunct.
ℹ Please use `tibble::rownames_to_column()` instead.
---
Backtrace:
     ▆
  1. ├─... %>% as.data.frame()
  2. ├─base::as.data.frame(.)
  3. ├─dplyr::mutate(., Time.X.Treatment = Time * Treat)
  4. ├─dplyr::mutate(...)
  5. ├─dplyr::mutate(., Subject = paste("S", Subject, sep = ""))
  6. ├─dplyr::select(., Sample, Subject, Time, Response, Treat)
  7. ├─dplyr::mutate(...)
  8. ├─dplyr::left_join(...)
  9. ├─dplyr::select(., Subject)
 10. ├─dplyr::filter(., count == 4)
 11. ├─dplyr::summarise(., count = n())
 12. ├─dplyr::group_by(., Subject)
 13. ├─dplyr::select(., Sample, Time, Subject, Response, Treatment.Specific)
 14. ├─dplyr::filter(., Treatment.Specific != "PEN")
 15. ├─dplyr::left_join(...)
 16. ├─dplyr:::left_join.data.frame(...)
 17. │ └─dplyr::auto_copy(x, y, copy = copy)
 18. │   ├─dplyr::same_src(x, y)
 19. │   └─dplyr:::same_src.data.frame(x, y)
 20. │     └─base::is.data.frame(y)
 21. └─dplyr::add_rownames(sample.info, var = "Sample")
 22.   └─lifecycle::deprecate_stop("1.0.0", "add_rownames()", "tibble::rownames_to_column()")
 23.     └─lifecycle:::deprecate_stop0(msg)

Error: processing vignette 'zibr.Rmd' failed with diagnostics:
add_rownames() was deprecated in dplyr 1.0.0 and is now defunct.
ℹ Please use tibble::rownames_to_column() instead.
--- failed re-building ‘zibr.Rmd’

SUMMARY: processing the following file failed:
‘zibr.Rmd’

Error: Vignette re-building failed.
Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.0.2
Check: re-building of vignette outputs
Result: ERROR
Error(s) in re-building vignettes:
--- re-building ‘zibr.Rmd’ using rmarkdown

Quitting from zibr.Rmd:169-286 [unnamed-chunk-11]

<error/lifecycle_error_deprecated>
Error:
! `add_rownames()` was deprecated in dplyr 1.0.0 and is now defunct.
ℹ Please use `tibble::rownames_to_column()` instead.
---
Backtrace:
     ▆
  1. ├─... %>% as.data.frame()
  2. ├─base::as.data.frame(.)
  3. ├─dplyr::mutate(., Time.X.Treatment = Time * Treat)
  4. ├─dplyr::mutate(...)
  5. ├─dplyr::mutate(., Subject = paste("S", Subject, sep = ""))
  6. ├─dplyr::select(., Sample, Subject, Time, Response, Treat)
  7. ├─dplyr::mutate(...)
  8. ├─dplyr::left_join(...)
  9. ├─dplyr::select(., Subject)
 10. ├─dplyr::filter(., count == 4)
 11. ├─dplyr::summarise(., count = n())
 12. ├─dplyr::group_by(., Subject)
 13. ├─dplyr::select(., Sample, Time, Subject, Response, Treatment.Specific)
 14. ├─dplyr::filter(., Treatment.Specific != "PEN")
 15. ├─dplyr::left_join(...)
 16. ├─dplyr:::left_join.data.frame(...)
 17. │ └─dplyr::auto_copy(x, y, copy = copy)
 18. │   ├─dplyr::same_src(x, y)
 19. │   └─dplyr:::same_src.data.frame(x, y)
 20. │     └─base::is.data.frame(y)
 21. └─dplyr::add_rownames(sample.info, var = "Sample")
 22.   └─lifecycle::deprecate_stop("1.0.0", "add_rownames()", "tibble::rownames_to_column()")
 23.     └─lifecycle:::deprecate_stop0(msg)

Error: processing vignette 'zibr.Rmd' failed with diagnostics:
add_rownames() was deprecated in dplyr 1.0.0 and is now defunct.
ℹ Please use tibble::rownames_to_column() instead.
--- failed re-building ‘zibr.Rmd’


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Ulthran <14882396+Ulthran@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix deprecated add_rownames() function in vignette Replace defunct dplyr::add_rownames() with tibble::rownames_to_column() Feb 4, 2026
Copilot AI requested a review from Ulthran February 4, 2026 17:54
@Ulthran
Copy link
Contributor

Ulthran commented Feb 4, 2026

@copilot Tests need to pass. Make sure you can build the vignettes without error before committing.

Co-authored-by: Ulthran <14882396+Ulthran@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 4, 2026

@copilot Tests need to pass. Make sure you can build the vignettes without error before committing.

Fixed both deprecated dplyr functions causing vignette build failures:

  1. Commit 295b6c5: Replaced add_rownames() with rownames_to_column() (4 instances)
  2. Commit 7ec0ac1: Replaced mutate_each(funs()) with mutate(across()) (2 instances)

The vignettes should now build without errors. The CI workflows are awaiting approval to run.

Copilot AI changed the title Replace defunct dplyr::add_rownames() with tibble::rownames_to_column() Fix deprecated dplyr functions in vignette Feb 4, 2026
@Ulthran Ulthran marked this pull request as ready for review February 4, 2026 22:59
Copilot AI review requested due to automatic review settings February 4, 2026 22:59
@Ulthran Ulthran merged commit 06ceba2 into master Feb 4, 2026
9 of 10 checks passed
@Ulthran Ulthran deleted the copilot/fix-deprecated-add-rownames-issue branch February 4, 2026 23:00
@Ulthran Ulthran mentioned this pull request Feb 4, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a build failure caused by deprecated dplyr functions that are now defunct in newer versions of dplyr. The vignette was failing to rebuild because it used add_rownames(), mutate_each(), and funs(), which were deprecated in dplyr 1.0.0 and 0.7.0 respectively.

Changes:

  • Replaced add_rownames() with tibble::rownames_to_column() in 4 locations
  • Replaced mutate_each(funs()) with mutate(across()) in 2 locations
  • Added library(tibble) to vignette setup and tibble to DESCRIPTION Suggests

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
vignettes/zibr.Rmd Updated deprecated dplyr functions to modern equivalents and added tibble library import
DESCRIPTION Added tibble package to Suggests field for vignette dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants