Enhances.RdThese functions improve the user experience of other packages.
## enchances 'package:box'
with_script_path(expr, file, local = FALSE, n = 0, envir = parent.frame(n + 1),
matchThisEnv = getOption("topLevelEnvironment"),
srcfile = if (n) sys.parent(n) else 0)
## enchances 'package:rprojroot'
make_fix_file(criterion, local = FALSE, n = 0, envir = parent.frame(n + 1),
matchThisEnv = getOption("topLevelEnvironment"),
srcfile = if (n) sys.parent(n) else 0)an expression to evaluate after setting the current script in
package:box; most commonly a call to
box::use().
a character string giving the pathname of the file.
argument passed to
rprojroot::find_root().
See
?this.path().
with_script_path() improves the experience of package:box; it
sets the current script in package:box to file or
this.path() using
box::set_script_path(), then evaluates its
argument, most commonly a package:box import statement.
make_fix_file() improves the experience of package:rprojroot; it
looks for a project root starting with this.dir(), then makes a
function that constructs file paths against said project root.
for with_script_path(), the result of evaluating expr.
for make_fix_file(), a function with formals (..., .. = 0) that
returns a character vector.
# @R_PACKAGE_NAME@::with_script_path(
# box::use(
# <import 1>,
# <import 2>,
# <...>
# )
# )
# ## replace 'rprojroot::is_r_package' with desired criterion
#
# fix_file <- @R_PACKAGE_NAME@::make_fix_file(rprojroot::is_r_package)