Skip to content

Report attached and loaded packages in reproducibility table#132

Merged
slager merged 2 commits intodevelopfrom
repro_tbl_namespace
Jan 7, 2026
Merged

Report attached and loaded packages in reproducibility table#132
slager merged 2 commits intodevelopfrom
repro_tbl_namespace

Conversation

@slager
Copy link
Contributor

@slager slager commented Dec 6, 2025

Inspired by FredHutch/VISCtemplates#314

Suggested review: Install this branch with remotes::install_github('FredHutch/VISCfunctions', ref = 'repro_tbl_namespace'), then knit a test report with VISCtemplates. The VISCtemplates skeleton will need an adjustment to allow a packages table to carry over onto a second page if needed.

@kelliemac
Copy link
Contributor

tested locally and it works great for me! here is a screenshot for posterity:

Screenshot 2025-12-05 at 5 58 27 PM

note: the way to resolve the associated issue with the VISCtemplates skeleton so that the packages table can be more than one page is just to add option longtable = TRUE to the kable() call.

thanks for tackling this @slager!

@kelliemac
Copy link
Contributor

associated changes for VISCtemplates: FredHutch/VISCtemplates#329

@kelliemac
Copy link
Contributor

@mayerbry do you know if HVTN folks use this function for their reports? if so, we should probably reach out to them.

@slager
Copy link
Contributor Author

slager commented Dec 6, 2025

Tagging @bneradil to weigh in for HVTN

@slager slager requested a review from bneradil December 6, 2025 15:25
@slager
Copy link
Contributor Author

slager commented Dec 8, 2025

Per Moni, HVTN SRA reports log get_session_info() to a text file, so the additional lines of output are not an issue. Per Radhika and Emily, this is also not an issue for HVTN STP reports.

@slager slager requested a review from lemireg December 17, 2025 19:49
@lemireg
Copy link

lemireg commented Dec 17, 2025

While playing around with doing this for one of my PDF outputs where I wanted to include dependencies in a reproducibility table, I noticed a relatively easy/predictable way we may be able to detect and throw the user a warning (which they can always suppress using warning = FALSE on the r chunk) when they got a package from network drive (usually where our datapackages are located) but then pull from a version stored locally (i.e. risking the have a datapackage stored locally). You could replace "cavd" and "Local" below with other path folder names that catch more cases (if for example we ever have datapackages stored in another folder than N:/cavd)

We could add a warning to this PR if we want to highlight these kinds of cases (even without printing out the local location of every package)

sessinfo <- session_info(pkgs = "loaded", info = "all", dependencies = TRUE)$packages
data.frame(pck = sessinfo$package,
           source = sessinfo$source,
           path = sessinfo$path) %>%
  dplyr::filter(grepl(pattern = "cavd", x = source) & grepl(pattern = "Local", x = path))

@slager
Copy link
Contributor Author

slager commented Jan 7, 2026

Note from VISCfunctions meeting:

Path-checking logic like suggested by @lemireg to go in a separate function, or at least in a separate PR

Copy link
Contributor

@mayerbry mayerbry left a comment

Choose a reason for hiding this comment

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

thanks!

@slager slager merged commit 5eb8569 into develop Jan 7, 2026
6 checks passed
@slager slager deleted the repro_tbl_namespace branch January 7, 2026 18:02
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.

4 participants