Enhances | R Documentation |
These 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)
expr |
an expression to evaluate after setting the current script in package:box; most commonly a call to \codelink3box:usebox::use(). |
file |
a character string giving the pathname of the file. |
criterion |
argument passed to \codelink3rprojroot:find_rootrprojroot::find_root(). |
local , n , envir , matchThisEnv , srcfile |
See
|
with_script_path()
improves the experience of \CRANpackagebox; it
sets the current script in package:box to file
or
this.path()
using
\codelink3box:script_pathbox::set_script_path(), then evaluates its
argument, most commonly a package:box import statement.
make_fix_file()
improves the experience of \CRANpackagerprojroot; 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.