from_here {fromhere}R Documentation

Create a File Path Relative to a Project Root

Description

These functions generate file paths relative to the root of a specific type of project. They use criteria from rprojroot to locate the root directory and construct paths using file.path().

Usage

from_here(...)

from_wd(...)

from_rproj(...)

from_r_package(...)

from_remake(...)

from_drake(...)

from_targets(...)

from_pkgdown(...)

from_renv(...)

from_projectile(...)

from_quarto(...)

from_git(...)

from_svn(...)

from_vcs(...)

from_testthat(...)

Arguments

...

Character components of the relative file path.

Details

Functions support two ways to specify paths: as function arguments (e.g., from_r_package("path/to/file")) or using the $ operator (e.g., from_r_package$path$to$file), which supports autocompletion.

The following ⁠from_*⁠ functions are available:

Value

A file path which allows further traversal with $ autocompletion.

See Also

rprojroot::find_root()

Examples

# Construct a path from the current working directory
from_wd()

## Not run: 
# Construct a path to a file in an R package
from_r_package("R", "my_file.R")

# Construct a path in a pkgdown project
from_pkgdown$docs$index.html

# Construct a path in a Git repository
from_git("src", "main.c")

## End(Not run)


[Package fromhere version 0.1.0 Index]