Description Usage Arguments Details Value Speed Search strategies Parallelism Examples
when_api_same
reports package versions where the API of a function was the same as now (or
the same as current_fun
).
when_fun_exists
reports package versions where a function exists.
1 2 3 4 5 6 7 8 9 | when_api_same(fun, package, current_fun = NULL, search = c("binary",
"forward", "backward", "all", "parallel"), report = c("full", "brief"),
quiet = TRUE, progress = interactive() && search != "parallel",
min_version = NULL, max_version = NULL, ...)
when_fun_exists(fun, package, search = c("binary", "forward", "backward",
"all", "parallel"), report = c("full", "brief"), quiet = TRUE,
progress = interactive() && search != "parallel", min_version = NULL,
max_version = NULL, ...)
|
fun |
Function name as a character string. |
package |
Package. Alternatively, specify the function name as e.g. |
current_fun |
Current function for comparison. By default, |
search |
"binary", "forward", "backward", "all" or "parallel". See Search strategies. |
report |
"brief" or "full". See Value. |
quiet |
Logical. Try to minimize output from package installation. (Some output comes
from |
progress |
Print a progress bar. |
min_version |
Lowest version to check. |
max_version |
Highest version to check. |
... |
Arguments passed to |
"Same API" means having the same function arguments, as reported by formals()
.
If report
is "brief", the earliest "known good" version.
Otherwise, a data frame of versions with a full results column.
This function may download and install multiple versions from MRAN, so it is likely to be slow
when first used (and even afterwards if library loading is slow). Using search = "parallel"
may help, but not if the network is the bottleneck: see
https://hughjonesd.github.io/apicheck/performance2.html for details.
"forward"
("backward"
) searches incrementally from the earliest (latest) version.
"binary"
does a binary search from the midpoint.
These strategies assume that API changes happen just once - i.e. once a function exists or API is the same as now, it will stay so in future versions. This allows them to stop before searching every version.
"all"
searches every version.
"parallel"
searches every version in parallel using parallel::parLapply()
.
For parallel search, you can set up your own parallel
cluster by using parallel::setDefaultCluster()
; otherwise one will be created, using
getOption("cl.cores")
cores if that is set. If you
set up your own cluster, it will not be stopped automatically (see
parallel::stopCluster()
).
1 2 3 4 5 6 7 8 | ## Not run:
when_api_same("read.dta", "foreign")
## End(Not run)
## Not run:
when_fun_exists('read.dta', 'foreign')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.