Skip to content

Conversation

@jdblischak
Copy link
Collaborator

tl;dr This PR makes minor edits to the documentation of the non-exported function hupdate() to unblock migration to roxgyen2 7.3.3

xref: Merck/simtrial#351

Background

When I update to roxygen2 7.3.3 and document the package, I receive the following messages:

==> Rcpp::compileAttributes()

* Updated R/RcppExports.R

==> devtools::document(roclets = c('rd', 'collate', 'namespace'))

ℹ Updating gsDesign2 documentationLoading gsDesign2gridpts_h1_hupdate.R:122: @param Could not resolve link to topic "h1" in the
  dependencies or base packages.If you haven't documented "h1" yet, or just changed its name, this is
  normal. Once "h1" is documented, this warning goes away.
ℹ Make sure that the name of the topic is spelled correctly.
ℹ Always list the linked package as a dependency.
ℹ Alternatively, you can fully qualify the link with a package name.
✖ gridpts_h1_hupdate.R:122: @param Could not resolve link to topic "hupdate"
  in the dependencies or base packages.
ℹ If you haven't documented "hupdate" yet, or just changed its name, this is
  normal. Once "hupdate" is documented, this warning goes away.Make sure that the name of the topic is spelled correctly.Always list the linked package as a dependency.Alternatively, you can fully qualify the link with a package name.
Documentation completed

I'm not certain exactly what caused this change between roxygen2 7.3.3 and 7.3.2, but my guess is that it was PR r-lib/roxygen2#1633 to "Resolve markdown links to external packages". It isn't worth investigating further because these messages are about the documentation for the internal function hupdate() which has the tag @noRd. Thus I fixed it by converting the links to code syntax.

Alternative considered

Since both h1() and hupdate() already have nice documentation written for them, my initial plan was to simply remove the @noRd tags. This didn't work though because they are not exported to NAMESPACE, and thus their examples fail. From R CMD check:

E  checking examples ... [109s] ERROR (1m 52s)
   Running examples in 'gsDesign2-Ex.R' failed
   The error most likely occurred in:

   > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
   > ### Name: h1
   > ### Title: Initialize numerical integration for group sequential design
   > ### Aliases: h1
   >
   > ### ** Examples
   >
   > # Replicate variance of 1, mean of 35
   > g <- h1(theta = 5, info = 49)
   Error in h1(theta = 5, info = 49) : could not find function "h1"
   Execution halted
E  checking examples with --run-donttest ... [267s] ERROR (4m 28.7s)
   Running examples in 'gsDesign2-Ex.R' failed
   The error most likely occurred in:

   > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
   > ### Name: h1
   > ### Title: Initialize numerical integration for group sequential design
   > ### Aliases: h1
   >
   > ### ** Examples
   >
   > # Replicate variance of 1, mean of 35
   > g <- h1(theta = 5, info = 49)
   Error in h1(theta = 5, info = 49) : could not find function "h1"
   Execution halted

The next consideration would be to export them, but they were explicitly un-exported for {gsDesign2} 1.1.0 (#253, #261), so I abandoned this approach.

- Unexport helper functions `gridpts()`, `h1()`, and `hupdate()` (#253).

@jdblischak jdblischak self-assigned this Dec 4, 2025
Copy link
Collaborator

@yihui yihui left a comment

Choose a reason for hiding this comment

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

Sounds good to me. Thanks!

@LittleBeannie LittleBeannie merged commit ae1ed90 into Merck:main Dec 4, 2025
7 checks passed
@jdblischak jdblischak deleted the roxy733 branch December 5, 2025 14:36
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