Description Usage Arguments Details Project root Examples
here()
uses a reasonable heuristics to find your project's files, based on
the current working directory at the time when the package is loaded.
Use it as a drop-in replacement for file.path()
, it will always locate the
files relative to your project root.
dr_here()
shows a message that by default also includes the
reason why here()
is set to a particular directory. Use this function
if here()
gives unexpected results.
set_here()
creates an empty file named .here
, by default
in the current directory. When here
encounters such a file, it uses the
directory that contains this file as root. This is useful if none of the
default criteria apply. You need to restart the R session so that here()
picks up the newly created file.
1 2 3 4 5 |
... |
|
show_reason |
|
path |
|
verbose |
|
This package is intended for interactive use only.
Use rprojroot::has_file()
or the other functions in
the rprojroot package for more control,
or for package development.
Starting with the current working directory during package load time, here
will walk the directory hierarchy upwards until it finds a directory that satisfies at least one of the following conditions:
contains a file .here
contains a file matching [.]Rproj$
with contents matching ^Version:
in the first line
contains a file DESCRIPTION
with contents matching ^Package:
contains a file remake.yml
contains a file .projectile
contains a directory .git
contains a file .git
with contents matching ^gitdir:
contains a directory .svn
Once established, the root directory doesn't change during the active R session. here()
then appends the arguments to the root directory.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.