The migration guide currently recommends using @exportS3Method lt::lt and then calling lt() directly:
|
# in R/as_lt.R; registered via @exportS3Method lt::lt |
|
Users then write `fixed_design_ahr(...) |> summary() |> lt()` in place of |
|
`... |> summary() |> as_gt()`. The full version in **gsDesign2** drives the |
This does not work as described. It will fail to find the function lt() since it isn't exported by the package. This would only work if the user independently loads {lt} with library("lt") or qualifies the namespace with lt::lt(), eg fixed_design_ahr(...) |> summary() |> lt::lt().
Given our current problems with as_gt() (keaven/gsDesign#297), I would like to do our best to eliminate these types of search path problems.
The recommendation from r-lib/generics is to re-export the generic:
To use generics with your package, we recommend that you import and re-export the generic(s) of interest.
If we decide to follow this recommendation, we would need to add the following code to the migration guide:
#' @importFrom lt lt
#' @export
lt::lt
I tested this locally with {gsDesign} and {gsDesign2} (using the example code from keaven/gsDesign#297, but replacing as_gt() with lt()). No matter which package is imported first, the call to lt() is properly dispatched to the correct S3 method.
xref: Merck/gsDesign2#629, keaven/gsDesign#282
The migration guide currently recommends using
@exportS3Method lt::ltand then callinglt()directly:lt/examples/03-gt.Rmd
Line 337 in f582454
lt/examples/03-gt.Rmd
Lines 362 to 363 in f582454
This does not work as described. It will fail to find the function
lt()since it isn't exported by the package. This would only work if the user independently loads {lt} withlibrary("lt")or qualifies the namespace withlt::lt(), egfixed_design_ahr(...) |> summary() |> lt::lt().Given our current problems with
as_gt()(keaven/gsDesign#297), I would like to do our best to eliminate these types of search path problems.The recommendation from r-lib/generics is to re-export the generic:
If we decide to follow this recommendation, we would need to add the following code to the migration guide:
I tested this locally with {gsDesign} and {gsDesign2} (using the example code from keaven/gsDesign#297, but replacing
as_gt()withlt()). No matter which package is imported first, the call tolt()is properly dispatched to the correct S3 method.xref: Merck/gsDesign2#629, keaven/gsDesign#282