Description Usage Arguments Details Project root Examples
here_file()
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.
1 |
... |
|
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.
If here_file()
raises an error or otherwise behaves unexpectedly,
you may have attached plyr or another package
after here.
Correct this using
the conflicted package,
or use here::here("data", "df.rda")
.
The project root is established with a call to here::
i_am()
.
Although not recommended, it can be changed by calling here::i_am()
again.
In the absence of such a call (e.g. for a new project), starting with the current working directory during package load time, the directory hierarchy is walked upwards until a directory with at least one of the following conditions is found:
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
In either case, here()
appends its arguments as path components
to the root directory.
1 2 3 4 5 6 | here_file()
## Not run:
here("some", "path", "below", "your", "project", "root.txt")
here("some/path/below/your/project/root.txt")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.