Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues found while refactoring workflow.pacta.report #78

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ importFrom(dplyr,mutate)
importFrom(dplyr,mutate_at)
importFrom(dplyr,n)
importFrom(dplyr,pull)
importFrom(dplyr,reframe)
importFrom(dplyr,rename)
importFrom(dplyr,row_number)
importFrom(dplyr,rowwise)
Expand Down
2 changes: 1 addition & 1 deletion R/create_interactive_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@

portfolio_parameters %>%
to_jsonp("data_parameters") %>%
writeLines(path(output_dir, "data", paste0("data_parameters", ".js")))
writeLines(fs::path(output_dir, "data", paste0("data_parameters", ".js")))

Check warning on line 154 in R/create_interactive_report.R

View check run for this annotation

Codecov / codecov/patch

R/create_interactive_report.R#L154

Added line #L154 was not covered by tests


# export environment info --------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions R/pacta.portfolio.report-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#' @keywords internal
"_PACKAGE"

## usethis namespace: start
#' @importFrom dplyr reframe
## usethis namespace: end
NULL
Comment on lines +1 to +7
Copy link
Member

Choose a reason for hiding this comment

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

sorry retrospectively, but... seems off that this file is necessary for just dplyr::reframe, probably suggests that this is unnecessarily a new and unique method (to this repo) of importing a function

Copy link
Member

Choose a reason for hiding this comment

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

My preferred method is usually to use an imports.R file: https://github.com/RMI-PACTA/r2dii.analysis/blob/main/R/imports.R

but that doesn't seem to be the Beta in pacta.portfolio.report? Unless there is a different approach already implemented here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It looks like we were already using the R package standard of putting importFroms in NAMESPACE, but usethis::use_import_from() requires having the package-level docs.

Loading